0 Replies Latest reply: May 2, 2012 4:55 AM by Faisal khan RSS

JSF2+richfaces4 spring managed beans got stuck in a4j:region bypassing validation on commandlink

Faisal khan Newbie

got stuck really bad with jsf2Richfacesspring managed beans

 

 

I am u sing following form with 2 regions first region saves data another dislays. When i click upon save button it by pass the validation and goes directly into action in java file.

 

any idea how to fix that

 

Another issue i found is that region2 which is render="reg_2" is not displaying updated values !!!!

 

<h:form id="create_form" method="POST">
 
<a4j:region id="reg_1">
 
<h:inputText id="field_1" value="#{myBean.field}" validatorMessage="Error: provide correct input." required="true" requiredMessage="Error: field is mendatory" maxlength="3">
<f:validateLength maximum="3"></f:validateLength>
</h:inputText>
 
<rich:message for="field_1" ajaxRendered="true"></rich:message>
 
 
<h:inputText id="field_2" value="#{myBean.field2}" validatorMessage="Error: provide correct input." required="true" requiredMessage="Error: field is mendatory" maxlength="3">
<f:validateLength maximum="50"></f:validateLength>
</h:inputText>
 
<rich:message for="field_2" ajaxRendered="true"></rich:message>
 
<a4j:commandLink value="save data" action="#{myBean.save}" render="reg_2"></a4j:commandLink>
 
</a4j:region>
 
<a4j:region id="reg_2">
 
<rich:popupPanel id="add_cabin_class_popup" modal="true" autosized="true" resizeable="false" width="500">
<h:outputText value="#{myBean.field}"></h:outputText> <h:inputText value="#{myBean.field2}"></h:inputText>
</rich:popupPanel>
 
</a4j:region>
 
@ some control bar i have button to open popup panel
 
<a4j:region>
<a4j:commandLink action="#{myBean.resetEditForm}"  oncomplete="#.show();" styleClass="BtnLink">
     
<h:outputText value="reset form"></h:outputText>*
</a4j:commandLink>
</a4j:region>
 
 
</h:form>