Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi ,
Can you please tell me-how to open a page in another tab using page reference?
Thanks in advance.
Try the below code:
/////////////////////// VF Pages ////////////////////////////////
<apex:page sidebar="false" standardStylesheets="false" controller="LinkController">
<apex:outputPanel styleClass="app-icon" layout="block" id="app">
<apex:form >
<apex:commandLink action="{!Save}" reRender="app" value="rediff" onclick="WindowNew()">
<script>
function WindowNew()
{
alert('abc');
window.open('http://www.rediff.com/');
}
</script>
</apex:commandLink>
</apex:form>
</apex:outputPanel>
</apex:page>
/////////////// Controller /////////////////////////
public class LinkController {
public PageReference Save()
{
String newPageUrl = 'http://www.rediff.com/';
return null;
}
}
check this out see if it helps for you
public PageReference CancelTicket()
{
pageReference ref = new PageReference(‘/apex/PageName’);
ref.setRedirect(true);
return ref;
}
Where PageName= name of the page which you want to create and open
give kudos if it helps