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
sanshasansha 

change the options on an input field of type multiselect

I am trying to change the select options of an input field of type multiselect picklist.
 
<apex:inputField id="grouplistid" value="{!Table1__c.Groups__c}">
<apex:selectOptions value="{!Groups}"/>
</apex:inputField>
 
The controller code is as below:
 
public List<SelectOption> GroupsList;
public List<SelectOption> getGroups() { 
              GroupsList = new List<SelectOption>();
              GroupsList.add(new SelectOption('TestGroup1','TestGroup1'));
              GroupsList.add(new SelectOption('TestGroup2','TestGroup2'));
                          
     return GroupsList;
                     
}
 
However I do not see the values TestGroup1 and TestGroup2 in the multiselect picklist. Instead I see the options given during creation of the input field.
 
Please let me know if it is possible to change the options of the input field of type multiselect picklist dynamically ?
Sam.arjSam.arj
inputField component is not customizable. It shows what it shows.

sanshasansha
Is there a way by which I can have a multi select component (similar to the input field of type multiselect) whose options can be changed dynamically ?
 
I have tried using selectList component. However it has only one box which shows both the selected and unselected values. I want a component having the available and selected box separate similar to the component shown for an input field of type multi select.
 
Please suggest.
rtuttlertuttle
I know it is an old thread, but you could rerender it based on an action.  Look at the rerender property and actionsupport tag.