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
Shree KShree K 

Page unable to rerender when fields in the fieldset made required on the VF Page

Hi, 
Based on the picklist values its asssigned fieldsets has to be displayed on the visualforce page,where the fields in the fieldset are required fields,so when i made them required either by using  the flag required="{!OR(f.DBRequired, f.required)}" or <apex:inputField value="{!Dom[f]}" required="{!i.DBRequired}", my page is not rerendering untill i fill the fields and click on save button it is not allowing me to select another value even if i select another option its related fieldset is not being displayed onthe page.on the other hand if remove those dbrequired/required parameters everything works fine but the fields in the fieldset are acting as, not required.
help will be appreciated in resolving this problem.

All that i need is when a picklist value is selected a fieldset assigned to it should be displayed and the fields should be madatory fields for the user
if there there any change of selection it has to do the same thing as it did for the previous selection.

Note: I trying to do this on a Webform for a custom object,not using any particular pageblock.

For Eg:
                                    <apex:selectOption itemLabel="Bio" itemValue="Bio"></apex:selectOption>
                                     <apex:selectOption itemLabel="Pharma" itemValue="Pharma"></apex:selectOption>

                    <apex:outputPanel id="fieldSet">
                    <apex:repeat value="{!$ObjectType.Domain_Obj__c.FieldSets[RequestValue]}" var="f">             
                    <apex:outputText value="*" style="float:left; position:relative; color:red;" rendered="{!OR(f.DBRequired, f.required)}"/>
                       <div class="row margin">
                        <div class="small-12 columns">
                           <legend> {!f.label}</legend>
                           <br/>
                            <apex:inputField value="{!Myextn[f]}"/>
                            <br/>
                        </div>
                      </div>
                    </apex:repeat>
                    </apex:outputPanel>

Thanks
CkRdy
Best Answer chosen by Shree K
Shree KShree K
Problem solved... i just kept everything in between actionregion ..all good now
 
<apex:actionRegion >
   <apex:selectList label="Request Type" value="{!RequestValue}" size="1" multiselect="false">
        <apex:actionSupport event="onchange"  reRender="fieldSet"/>
            <apex:actionstatus startText="Applying Values"></apex:actionstatus>
          <apex:selectOption itemLabel="" itemValue="picklistval1"></apex:selectOption>
          <apex:selectOption itemLabel="" itemValue="picklistval2"></apex:selectOption> 
</apex:actionRegion>

 

All Answers

James LoghryJames Loghry
It sounds like the "RequestValue" is not getting updated properly.  Are you rerendering the "fieldSet" outputPanel?  If not, you should be.  Also note that the rerender tag is case sensitive.

If that doesn't work, could you try posting the entirety of your VF page, along with the controller?  When doing so, please utilize the code format button (< >).  Thanks!
Shree KShree K
Problem solved... i just kept everything in between actionregion ..all good now
 
<apex:actionRegion >
   <apex:selectList label="Request Type" value="{!RequestValue}" size="1" multiselect="false">
        <apex:actionSupport event="onchange"  reRender="fieldSet"/>
            <apex:actionstatus startText="Applying Values"></apex:actionstatus>
          <apex:selectOption itemLabel="" itemValue="picklistval1"></apex:selectOption>
          <apex:selectOption itemLabel="" itemValue="picklistval2"></apex:selectOption> 
</apex:actionRegion>

 
This was selected as the best answer