Picklist 1 values: Yes No
Picklist2 values:
one two three
I was able to attain the rerendering functionality from the below sample code. If I select picklist1 value as "yes", I am able to display picklist2. And now if I select picklist2 value as "three" and change picklist1 value to "No", Picklist2 value is disappeared from the page, so far so good. Now when I change the Picklist1 value back to "Yes", the Picklist2 value is rerendered on page with value as three. I want to reset the Picklist2 value to none. I need similar funtionality to be implemented with all the text and other fields. Any help is much appreciated.Thanks.
Vfpage
<apex:pageblockSectionItem> <apex:inputfield value="{!picklist1}" onchange="reset();"> </apex:pageblockSectionItem>
<apex:pageblockSectionItem rendered = "{!value}"> <apex:inputfield value="{!picklist2}"> </apex:pageblockSectionItem>
<apex:actionfunction name=reset action="{!check}">
Controller
public boolean value{get;set};
public void check(){
if(picklist1 == 'yes')
{
value=true;
}
else{
value = false;
}
}