Find your content:

Search form

You are here

How can i dynamically include another VF page in a tab.


I have created dynamic tabs using following code -

public Component.Apex.TabPanel getMyTabs()
    Component.Apex.TabPanel myTabPanel = new Component.Apex.TabPanel();  
     for (integer i=0 ;i<menus.size();i++)  //just a sample, this could easily be a SOQL loop
         Component.Apex.Tab myTab = new Component.Apex.Tab();
         myTab.Label = menus.get(i).name; =  menus.get(i).name;
         myTab.switchtype = 'client';
         //Want to associate a VF page with this Tab so that if someone Click this tab  
         associated VF page content render in body part.'font-family: Arial, Helvetica, sans-serif; color: #000000;  background-image: url(/dimg/portalTabActiveRight000099C2E4FE.gif)';
    return myTabPanel;

I Want to associate a particular VF page with each Tab so that if someone Click that tab
associated VF page content render in the body part.

menus list also contains target VF page related path which will be displayed when user clicks in respective tab.

I am not getting anything how to do this. Can someone help me plz

Attribution to: Pramod Kumar

Possible Suggestion/Solution #1

 <apex:outputLink value="{!$Page.calypso_latest_news}?cat=press releases">Press releases</apex:outputLink></li> 

I think I've had the same problem before We have news section where it renders to different categories e.g. Events, press releases and I use the link above to render it.
There is also a different thing you can do on the vf page in order to display different information, specific for different categories

<apex:outputText value="Product launches" rendered="{!$'product launches'}" />
<apex:outputText value="Events" rendered="{!$'events'}" />

<apex:outputText value="Find out the latest about" rendered="{!$'press releases'}" />
<apex:outputText value="Incident Updates" rendered="{!$'incident updates'}" />**

So if you have 3 tabs you can put

  <apex:outputLink value="{!$Page.Tab1}?cat=info1 ">Tab1</apex:outputLink></li>
  <apex:outputLink value="{!$Page.Tab1}?cat=info2 ">tab2</apex:outputLink></li>
  <apex:outputLink value="{!$Page.Tab1}?cat=info3 ">Tab3</apex:outputLink></li> 

And render information using

<apex:outputText value="Some Info Here" rendered="{!$'info1'}" /> 

Attribution to: Greg

Possible Suggestion/Solution #2

did u try using <apex:iframe src="Vf_page"> in the page and embed the vf

Attribution to: Rao
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content