I have an <apex:tabPanel>
with several <apex:tab>
.
In my first tab, I have an <apex:commandButton>
and I want to switch to the second tab after a click on it. Is it possible ?
Here is my VisualForce page :
<apex:page>
<apex:tabPanel>
<apex:tab label="tab1" name="tab1" id="tab1">
<apex:commandButton onclick="switchToSecondTab()"/>
</apex:tab>
<apex:tab label="tab2" name="tab2" id="tab2">
</apex:tab>
</apex:tabPanel>
<script type="text/javascript">>
function switchToSecondTab() {
// What do I need to do here to switch to tab2 ?
}
</script>
</apex:page>