February 8, 2013

How to make a tab default in apex:tabPanel while opening the page?

Sample Code:

Visualforce page:

 <apex:page controller="Sample" sidebar="false">
<apex:form >
    <apex:tabPanel id="theTabPanel" selectedTab="Two" value="{!tabOpt}">
        <apex:tab label="One" name="One" id="One"><apex:commandButton value="Go to Two" action="{!switch}"/></apex:tab>
        <apex:tab label="Two" name="Two" id="Two">content for tab two</apex:tab>

Apex Controller:

public class Sample

    public String tabOpt { get; set; }
    public void switch()


No comments:

Post a Comment