I am working on creating a visualforce page (edit page), in which there is a picklist field. The values that are available within this picklist field should be dependent on whether or not a number of checkbox fields are selected.
Example:
If checkbox A is selected, values 6, 7, 8, and 9 should be available in the picklist
If checkbox B + C are both selected, values 1, 2, and 3 should be available
If checkbox B + D are both selected, value 4 should be available
If all checkboxes are selected, all values should be available
The checkbox fields already have actionsupport – onchange enabled to control visibility on the page for some other fields by rerendering the page.
Would anyone be able to help me by providing some sample code that would enable the above functionality? So far, my page is only using the standard controller for the object.
Thanks in advance,
Aaron
Best Answer
This should get you started:
Learn from here how to work on custom picklist. http://www.infallibletechie.com/2012/10/dependent-picklist-using-apex-in.html
Modified the picklist to checkboxes. change the code below to your requirement.
Page:
Controller: