You need to sign in to do that
Don't have an account?

How to find which tab is clicked?
Hi..
I am using <apex:tabpanel> for displaying tabs One & Two.. I want to know which tab is selected
<apex:page id="thePage"> <apex:outputtext> Here I have to display some content based on tab selection </apex:outputtext> <apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel"> <apex:tab label="One" name="A" id="tabOne">content for tab one</apex:tab> <apex:tab label="Two" name="B" id="tabTwo">content for tab two</apex:tab> </apex:tabPanel> </apex:page>
Based on the tab selection I have to do some calculation and display some content... If tab One is selected I have to display Tab One is selected like that..
Is it possible in VF..?
I believe that you want the value="{!selectedTab}" in the apex : tab component
value
The current active tab. You can specify this with an expression to dynamically control the active tab. For example, value="{!TabInFocus}", where TabInFocus is a variable set by a custom controller.
Thanks for ur reply Ron & Venkat
Venkat:
" I have to do some calculation based on tab selection" -- Ur code just alert some message..
Ron:
There is no value attribute in tab component... What is the use of value attribute in tabpanel Component...
Still I am in starting position ..
it specifies which panel to draw, and which was clicked on,bind this to a string in your controller, with a getter and setter, throw in a debug statement as well.
or check the docs on this component.
here is the answer with sample code:
Saravanan
This solution wont work, as it reloads the complete page and how to achieve this functionality withut reloading the complete page, just like switch type as client. I'm also in need of same solution