You need to sign in to do that
Don't have an account?
naveen reddy 68
tabpanel in visualforce page
I have created a visual force page with two tabs for the same object fields.
when i click on the button it must go to second tabs.
Here is my code:
<apex:page standardController="product_Development__c" extensions="HistoryPageController">
<apex:form >
<apex:pageblock title="VF Page Tabs" >
<apex:tabPanel id="theTabPanel" value="{!tabOpt}" >
<apex:tab label="Basic Info">
<b>Name:</b><apex:inputField value="{!product_Development__c.name}"/><br/>
<b>closed Date:</b>
<apex:inputField value="{!product_Development__c.Policy_Name__c}"/>
<br/>
<b>Education Requirement:</b><apex:inputField value="{!product_Development__c.Policy_Name__c}"/><br/>
<apex:commandButton value="Go to Two" action="{!switch}" rerender="theTabPanel"/>
</apex:tab>
<apex:tab label="DetailPage">
<b>Apex:</b><apex:inputField value="{!product_Development__c.product_Id__c }"/><br/>
<b>Max_Pay:</b>
<apex:inputField value="{!product_Development__c.product_Id__c}"/>
<br/>
<b>Min_Payt:</b><apex:inputField value="{!product_Development__c.product_Id__c}"/><br/>
</apex:tab>
</apex:tabPanel>
</apex:pageblock>
</apex:form>
</apex:page>
apex class:
public class HistoryPageController
{
public String tabOpt {get;set;}
private ApexPages.StandardController controller;
public HistoryPageController(ApexPages.StandardController controller)
{
this.controller = controller;
}
public void switch()
{
tabOpt = 'DetailPage';
}
}
here the button is created and it not switching the second tab.
Please help me.
when i click on the button it must go to second tabs.
Here is my code:
<apex:page standardController="product_Development__c" extensions="HistoryPageController">
<apex:form >
<apex:pageblock title="VF Page Tabs" >
<apex:tabPanel id="theTabPanel" value="{!tabOpt}" >
<apex:tab label="Basic Info">
<b>Name:</b><apex:inputField value="{!product_Development__c.name}"/><br/>
<b>closed Date:</b>
<apex:inputField value="{!product_Development__c.Policy_Name__c}"/>
<br/>
<b>Education Requirement:</b><apex:inputField value="{!product_Development__c.Policy_Name__c}"/><br/>
<apex:commandButton value="Go to Two" action="{!switch}" rerender="theTabPanel"/>
</apex:tab>
<apex:tab label="DetailPage">
<b>Apex:</b><apex:inputField value="{!product_Development__c.product_Id__c }"/><br/>
<b>Max_Pay:</b>
<apex:inputField value="{!product_Development__c.product_Id__c}"/>
<br/>
<b>Min_Payt:</b><apex:inputField value="{!product_Development__c.product_Id__c}"/><br/>
</apex:tab>
</apex:tabPanel>
</apex:pageblock>
</apex:form>
</apex:page>
apex class:
public class HistoryPageController
{
public String tabOpt {get;set;}
private ApexPages.StandardController controller;
public HistoryPageController(ApexPages.StandardController controller)
{
this.controller = controller;
}
public void switch()
{
tabOpt = 'DetailPage';
}
}
here the button is created and it not switching the second tab.
Please help me.
You can use below code:
Hope this will help you.
Please let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
All Answers
You can use below code:
Hope this will help you.
Please let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
Sohan Raj Gupta, thanks for you help.