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
vishwa attikerivishwa attikeri 

Problem in apex:tab

In apex:tab i have next button to move to next tab but it workds only when disabled="true" how can i use this for disabled="false"

 

here is my code:

<apex:tabPanel id="tabPanel" selectedTab="{!selectedTab}" tabClass="tabClass" immediate="true">
<apex:tab label="First tab" id="tab1" style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button"  immediate="true"/>
</apex:tab>
<apex:tab label="First tab" id="tab2 style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button" immediate="true"/>
</apex:tab>
<apex:tab label="First tab" id="tab3" style="font-size:13px;">
<apex:commandButton value="Next Step" action="{!enabletab2}" rerender="tabPanel" styleclass="button" immediate="true"/>
</apex:tab>
</apex:tabpanel>
 

 

 public void enabletab2() {  selectedtab = 'tab2';}
    public void enabletab3() {  selectedtab = 'tab3'; }
    public void enabletab4() {  selectedtab = 'tab4'; }
     public void enabletab5() {  selectedtab = 'tab5';}

 

how can i solve this 

 

 

 

 

APathakAPathak

Please use "value" instead of "selectedtab"

 

<apex:tabPanel id="tabPanel" value="{!selectedTab}" tabClass="tabClass" immediate="true">
APathakAPathak

Hi,
The following code is working.

<apex:page standardController="Child__c" extensions="hello16Controller">
<apex:form id="theform">
<apex:tabPanel id="tabPanel" value="{!selectedTab}" switchType="client" >

<apex:tab label="First tab" name="tab1" style="font-size:13px;" >
{!selectedTab}
<apex:commandButton value="Next Step" action="{!enabletab2}" />
</apex:tab>
<apex:tab label="Second tab" name="tab2" style="font-size:13px;">
{!selectedTab}
<apex:commandButton value="Next Step" action="{!enabletab3}" />
</apex:tab>

<apex:tab label="Third tab" name="tab3" style="font-size:13px;">
{!selectedTab}
<apex:commandButton value="Next Step" action="{!enabletab4}" />
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>