Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JSF + A4J + Validation

843844May 2 2008
Hi,

I'm new to JSF and I'm having problems with validation with JSF and A4J.

I have a table that has an onRowClick event listener:
<a4j:region>
<rich:dataTable  width="700" id="staffList" rows="4" columnClasses="col"
					value="#{StaffAdminBean.staffList}"
					var="staffMember">
        <rich:columnGroup>
		<h:column>
         ..
         ..
         ..
        <a4j:support 
		                event="onRowClick"
				actionListener="#{StaffAdminBean.getStaffMemberForUpdate}"
				reRender="	staffEditGrid1, 
    		 	 			        staffEditGrid2,">
				<f:param name="updateStaffId" value="#{staffMember.id}"/>
	</a4j:support>
	</rich:dataTable>
</a4j:region>
This works fine... the action loads the staff member properties into a managed bean from the DB.
These bean properties are mapped to some entry fields and can then be edited for update.

This all works fine until there is a validation error in one of the update fields.
When this happens and I click on another entry in the row, the entry fields are NOT updated with the new Bean Properties.
ONLY the field that had the validation error is updated... the rest are stuck with the old values even though the listener action is updating the bean
properties that are declared in the value attributes of the entry fields.

Here is an example of one of the entry fields.
<h:panelGrid columns="3" cellpadding="5" id="staffEditGrid1">
	<h:outputLabel for="nameInput">
		<h:outputText value="Name: "/>
	</h:outputLabel>
	<h:inputText id="nameInput" value="#{StaffAdminBean.name}" size="40" required="true">
		<f:validateLength minimum="5"/>
	</h:inputText>
	<rich:message for="nameInput"/>
Any help would be greatly appreciated as I've been trying to get this page working for the last 2 days :-(

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 30 2008
Added on May 2 2008
0 comments
186 views