I have used the below component and please guide me how to create the onchange event attribute.
Code gets from : https://developer.salesforce.com/blogs/developer-relations/2012/06/a-multiselect-picklist-visualforce-component.html
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Get the parent id for component and assign the blank value for each component.
e.g :
if( listBox.options.length > 1 & listBox.options[0].value == '--NONE--'){ listBox.options.remove(0); //listBox.options.add(0); }
Method 2
update the following line of code… (37). you need to check with size of the list and also add the same panel in this line(75)
<apex:outputPanel rendered="{!IF(leftOptions.size == 0, true, false)}"> <option value="" disabled="true" id="rightNone">--NONE--</option> </apex:outputPanel>
I hope this will help you…
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0