+ Start a Discussion

Immediate="true" on commandbutton Avoiding validation error but not capturing user input


Below is the code for vf page:

<apex:repeat id="repeat" value="{!InnerList}" var="in">
  <apex:selectList value="{!in.selectedValue1}" id="value1" required="true" multiselect="false" style="width:200px;" size="1">
     <apex:selectOptions id="options" value="{!Header}"/>
  <apex:selectList value="{!in.selectedValue2}" id="value2" multiselect="false" required="true" style="width:200px;" size="1">
     <apex:selectOptions id="options1" value="{!FieldList}"/>

     <apex:actionRegion >   
    <apex:commandButton id="Next" value="SavetoObject"  action="{!saveToObject}" immediate="true" />

 Here if i don use immediate=true,i get validation error like:

 j_id0:j_id2:j_id33:repeat:0:value1: Validation Error: Value is not valid


and when i use immediate=true validation error disappears but it doesnot capture my user input.

I found a solution some where that using action region i can make it capture my user input.

Can any one explain me.

Above is the link for action region solution.





but i don know how to use it in my context.

Can some one please help.