TabPanel switchType=server how to track the active tab?

 I am trying to track which tab is clicked and displayed the content of clicked tab only. Since we have 8 tabs and each one has at least a form so I just want to render the tab it was just clicked; otherwise it generates bunch view state which slows down ajax call. Visualforce:

Controller: public with sharing class MyControllerExtension{ public String currentTabName; public String selectedTab { get { return currentTabName; } } public String setActiveTab(){ String para = ApexPages.CurrentPage().getParameters().get('tabname'); System.debug('current tab is ' + para); } }

This is what my tabpanel looks like. I tried set up actionFunction and call the function on apex:tab I wasn't able to send the tab name successfully



Your action function for switchtype should look like the following:

Controller: Private String var = 'photos'; public void setVar(String n) { var = n; } public String getVar() { return var; }



Your Answer

Interviews

Parent Categories