When changing a multiselect field I am calling a updateLOBlist() method to update a string (multiSelectValues.) However, when deselecting values from the multiselect I am not seeing the string values change. In this example I originally had selected AH, CommercialAuto, GeneralLiability, Homeowners, NonStandardAuto, PersonalAuto but when deselecting the string does not change.
Debug after removing items: AH, CommercialAuto, NonStandardAuto, PersonalAuto
DEBUG|UPDATED LOBS {AH, CommercialAuto, GeneralLiability, Homeowners, NonStandardAuto, PersonalAuto}
DEBUG|LOB FOUND NONSTDAUTO
public Set<String> multiselectValues = new Set<String>();
Public Void updateLOBlist() {
multiSelectValues.addAll(CCRA.Lines_of_Business__c.split(';'));
System.debug('UPDATED LOBS ' + multiSelectValues);
if(multiSelectValues.contains('NonStandardAuto')){
System.debug('LOB FOUND NONSTDAUTO ');
}else {
System.debug('NO LOB FOUND');
}
}
Visualforce Page with Multiselect
<apex:pageBlockSectionItem dataStyleClass="col" >
<apex:actionRegion >
<apex:inputField id="LOB" value="{!Claims_Client_Risk_Assessment__c.Lines_of_Business__c}" styleClass="col2" >
<apex:actionSupport action="{!updateLOBlist}" event="onchange" reRender="theLOBTabPanel,OutputLOBTabPanel,theLOBTabPanel1" / >
</apex:inputField>
</apex:actionRegion>