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
mmaxtrammaxtra 

Refresh picklist value to none????

Hi:

   I have a table that has a selectoption Picklist... and it is shown when a checkbox is true..

Now when you click off the checkbox , the picklist is hidden but the value stays in there as it was selected from the user....

 

Does anyone know a way to set the value of the picklist to a particular value if checkbox is not true????

 

Thanks 

Best Answer chosen by Admin (Salesforce Developers) 
Anand@SAASAnand@SAAS
Call a controller method "onClick". If the value is "False", set the "engName" value to what you want to set. Also in your constructor or init method set the value of "engName" to what you want to default to.

All Answers

TehNrdTehNrd
Are you using an apex controller?
MMA_FORCEMMA_FORCE

Yes I am...

Here is my VF:

 

<apex:inputCheckbox value="{!the_checkbox}"><apex:outputLabel value="Advance Filter" for="the_checkbox"/> <apex:actionSupport event="onclick" reRender="adva"/> </apex:inputCheckbox><apex:pageBlock id="adva" ><apex:pageBlockSection rendered="{!the_checkbox}" columns="1" collapsible="false" ><apex:pageBlockSectionItem > <apex:outputLabel value="English Proficiency" /> <apex:selectList value="{!engname}" size="1"> <apex:selectOption itemValue="ALL" itemLabel="Please Select a Value"/> <apex:selectOption itemValue="Fluent English Speaker" itemLabel="Fluent English Speaker"/> <apex:selectOption itemValue="Native English Speaker" itemLabel="Native English Speaker"/> <apex:selectOption itemValue="Non-English Speaking" itemLabel="Non-English Speaking"/> <apex:selectOption itemValue="Limited English Proficient/English Language Learner" itemLabel="Limited English Proficient/English Language Learner"/> <apex:selectOption itemValue="Redesignated As fluent English Proficient" itemLabel="Redesignated As fluent English Proficient"/> <apex:selectOption itemValue="Unknown" itemLabel="Unknown"/> </apex:selectList></apex:pageBlockSectionItem></apex:pageBlockSection></apex:pageBlock>

 Here is my Apex:

 

public String engname {get{return engname ;} set{ engname = value; }}public Boolean the_checkbox {get{if(the_checkbox== null){the_checkbox= false;}return the_checkbox;}set;}

 Am I doing something wrong in my Apex?

Thank you 

 

 

 

 

Anand@SAASAnand@SAAS
Call a controller method "onClick". If the value is "False", set the "engName" value to what you want to set. Also in your constructor or init method set the value of "engName" to what you want to default to.
This was selected as the best answer