+ 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

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
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
 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

You can try with



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