I am facing a strange problem. Actually few of my form fields visibility depends on picklist selected data. for example If i select "Yes"
in Previously_Applied__c
picklist then "Previously_Applied_When__c"
input field should be displayed.
I have implemented the same (have pasted code below) but when i select "Yes"
in Previously_Applied__c
picklist "Previously_Applied_When__c"
input field get displayed but i lost all form data(form fields sets to their default).
Plz suggest me How can i resolve this.
<apex:pageBlockSection title="Academic Interests" columns="2" collapsible="false" id="academic">
<apex:repeat value="{!applicationFields}" var="f">
<apex:inputField value="{!applicationDetails[f]}" required="{!OR(f.required,f.dbrequired)}"
rendered="{!(f != 'Previously_Applied__c' && f != 'Previously_Applied_When__c')}" />
<apex:pageBlockSectionItem rendered="{!(f == 'Previously_Applied__c')}">
<apex:outputLabel value="Have you applied to Utica College before?"/>
<apex:actionRegion >
<apex:inputField value="{!applicationDetails[f.fieldpath]}" required="{!OR(f.required,f.dbrequired)}">
<apex:actionSupport event="onchange" rerender="academic"/>
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem rendered="{!(f == 'Previously_Applied_When__c' && applicationDetails.Previously_Applied__c == 'Yes')}">
<apex:outputLabel value="When did you previously apply?" />
<apex:inputField required="{!OR(f.required,f.dbrequired)}" value="{!applicationDetails[f]}" />
</apex:pageBlockSectionItem>
</apex:repeat>
</apex:pageBlockSection>