function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
开发商开发商 

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?

 

 

 

Venkat PolisettVenkat Polisett

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.

 

 

Message Edited by Venkat Polisett on 03-24-2009 01:29 PM
Cool_DevloperCool_Devloper

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