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
GobbledigookGobbledigook 

Unchecking selectcheckboxes through Apex

Hello there,

 

I'm currently working with a dynamic selectcheckboxes list in Visualforce, and I need to uncheck the checked boxes through Apex whenever a commandbutton is pressed.  I figure it might have something to do with selectOptions list, but I'm not certain. 

Any ideas or help would be appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
GobbledigookGobbledigook

Nevermind.  Got it to work.

 

Turns out that trying to manipulate SelectOptions is actually the 100% wrong thing to do. 

And in actuality, it's very simple in its execution:  Since the getters and setters are "controlling" the selectoptions list, basically what you have to do is clear the constructor itself, rerender the part of the page that will call the list, repopulating it with empty values.