function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brijesh KumarBrijesh Kumar 

how can disable open in new window or open in new tab for right click the apex:outputlink link

Hi
i create a output link in visual force page.
<apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>
when we right click the this link we wants to disable (open in new window)  or (open in new tab)
how can get this functionality in output link.please give me a reply because it's very urgent in my project requirement.
 
 
Thanks & Regards
Brijesh Kumar Baser
 
ShamSham
May be you can handle this by disabling the context menu
But this will prevent the whole context menu from appearing.

This works on IE not sure about Mozilla.
<a href ="#" oncontextmenu="return false">
Brijesh KumarBrijesh Kumar
hi sham
 
your idea is not work on <apex:outputlink> because there is no attribute of oncontextmenu .
 
can u give me how can write in visualforce <apex:link>.
 
I shown the error when i used for apex:outputlink
 
Error: Unsupported attribute oncontextmenu in <apex:outputLink>
 
Thanks & Regards
Brijesh Kumar Baser
ShamSham
 Try using simple the anchor tag.instead of outputLink.




Brijesh KumarBrijesh Kumar
Hi sham
there is no option for apex tags.Because I used <apex:outputlink> in my project. so i have to changes so many time.
If no option then i will change.
 
Thanks & Regards
Brijesh Baser
PbondalapatiPbondalapati

You can try with

 

 

<apex:outputlink value= "https:/www.salesforce.com" id="thelink" target="_blank">www.salesforce.com</apex:outputlink>