You need to sign in to do that
Don't have an account?
开发商
tabPanel: multiple tabs and single method?
I have 1 account with 10 contacts. I want to list contacts with a last name starting with A-M on tab 1 and N-Z on tab 2.
I currently have 2 get methods in my controller to make this work. Is there anyway to reduce the controller code to 1 method or will each tab require its own get method?
Take a look at <apex:actionFunction> standard component.
On the tab's onclick event, pass your filter condition. In the definition of actionfunction, use <apex: param> that can set a property in to your controller with the filter condition.
You can use this value in your SOQL to filter what you want to include in the list that is rendered on the tab.
Hi,
You can set a Variable in the controller and can set its value in the VF page depending on the Tab selected.
Then you can execute the query inside a single method as per the value passed to the controller.
Hope this helps!!
Cool_D