You need to sign in to do that
Don't have an account?
Shane K 8
Visualforce link right click to open in a new tab
Hello,
I have a visualforce page that has link to a record id, when left click the link the record opens fine. When I right on that link and choose "Open link in a new tab" a new tab opens but the the URL is "about:blank#blocked". How can I display the record page in the new tab?
Thanks.
I have a visualforce page that has link to a record id, when left click the link the record opens fine. When I right on that link and choose "Open link in a new tab" a new tab opens but the the URL is "about:blank#blocked". How can I display the record page in the new tab?
Thanks.
Here you can make use of output Link that works as anchor tag ( i.e <a href="#">click</a>). This works fine for the above requirement.
Try the below code snippet as a reference.
<apex:page controller="cmdlinkDemo" >
<apex:form >
<apex:commandLink action="{!gogoogle}" target="_blank" value="Go Google" id="theCommandLink"/><br/>
<apex:outputLink value="https://www.google.co.in/" id="theLink">Go Google2</apex:outputLink>
</apex:form>
</apex:page>
=====Apex Controller========
public class cmdlinkDemo
{
public PageReference gogoogle()
{
PageReference pageRef = new PageReference('https://www.google.co.in/');
pageRef.setRedirect(true);
return pageRef;
}
}
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
Thanks for the example. I have the following code in my VF page. I am not sure how to fit the new tab functionality with reference to your example. Can you please help me?
Thanks.