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
Sisodia SaurabhSisodia Saurabh 

Need solution to open VF page in new tab

Hi All,
I want to implement a functionality in which when user click on Item it should display information in new Tab instead of new page.
My scenario description:
Name       First Name   Last Name Phone NoStart Date DOB Prog Lang
Emp-0034 Runthistime

 <apex:column headerValue="Name" >
          <apex:outputLink value="/apex/Emp_DisplayForm?id={!a.id}"> {!a.name}</apex:outputLink>                               
  </apex:column>
On click of Emp-0034. it opens item in my custom Emp_DisplayForm as new page. But I want it to be open in new tab?

Thanks.
Srb


 
Pankaj_GanwaniPankaj_Ganwani
Hey,

Just mention target="_blank" with your apex:outputLink tag.
<apex:column headerValue="Name" >
          <apex:outputLink value="/apex/Emp_DisplayForm?id={!a.id}" target="_blank"> {!a.name}</apex:outputLink>                               
  </apex:column>

 
DeveloperSudDeveloperSud
Hi Saurabh,

You can try like below.
 
<apex:column headerValue="Name" >
          <apex:outputLink value="/apex/Emp_DisplayForm?id={!a.id}" target="_blank"> {!a.name}</apex:outputLink>                               
  </apex:column>

 
Sisodia SaurabhSisodia Saurabh
Thanks for quick reply guys. I am don't want to open it new tab of browser.
I want to create a tab in same Page and open Emp_DisplayForm in it.
I think I have to use apex:tabpanel and switchtype = Ajax.
But I am not able to implement it. Not able to connect the activation of apex:tab on outputlink click. 
DeveloperSudDeveloperSud
Hi Saurabh,

Hope this below code will help you.
<apex:page standardController="account" recordSetVar="acts" id="thepage">
<apex:tabPanel switchType="Ajax" selectedTab="name1" id="theTabPanel">
 <apex:tab label="Name" name="name1" id="tabOne">
 <apex:pageBlock >
  <apex:pageblockTable value="{!acts}" var="a">
        <apex:column >
          <apex:outputLink value="/apex/Emp_DisplayForm?id={!a.id}" target="_self" > {!a.name}</apex:outputLink> 
        </apex:column>                               
  </apex:pageblockTable>
 </apex:pageBlock>
 </apex:tab>        
</apex:tabPanel>  
</apex:page>

Please do not forget to mark it as solved if this helps you.Thanks!!!