You need to sign in to do that
Don't have an account?
Melliott
Mutli - Select Picklist values not rerendering page
I have a multi select picklist that rerenders sections of a page. It currently only works if one value is selected. How do I get it to work if two values are selected.
Here is a section of the page.
<apex:pageBlockSection title="ED Experience" id="ED" columns="1" rendered="{!isFT}" > <apex:OutputText style="font-size: larger; font-weight: bold;" value="Please provide a brief summary of your Emergency Department experience."/> <apex:inputField value="{!application.ED_Experience__c}"/> </apex:pageBlocksection> <apex:pageBlockSection title="Emergency Department Physician's Certification of Competency" id="CTED" columns="1" rendered="{!isFT}">
Here is the pertinent pieces of the controller
private Set<String> EDtypes = new Set<String> {'ED Full Time', 'ED Part Time'}; private Set<String> Midtypes = new Set<String> {'Fast Track Full Time','Fast Track Part Time','Clinic Part Time','Clinic Full Time'}; private Set<String> EDMidtypes = new Set<String> {'ED Full Time', 'ED Part Time','Fast Track Full Time','Fast Track Part Time','Clinic Part Time','Clinic Full Time'}; private Set<String> Hosptypes = new Set<String> {'Hospitalist Full Time','Hospitalist Part Time'}; public Boolean getIsFT () { return EDtypes.contains(application.Practice_Preference__c); } public Boolean getIsFTMID () { return EDMidtypes.contains(application.Practice_Preference__c); } public Boolean getIsMid() { return Midtypes.contains(application.Practice_Preference__c); }
I tried changing IsFT to IsFTMid in the VF page but it does not render when both ED Full time and Clinic Full Time (for example) are selected. Any help is greatly appreciated.
Can you show us the code that controls the re-rendering? Presumably there is a command button or similar?
Looking in more detail, the rerendering probably isn't important.
When you choose multiple items from a multi-select picklist, they are stored in the field as a semi-colon separated string, so when you examine your sets to see if they contain the value, they wont'!
You'll need to iterate the field contents and compare each element.
Something like: