Burton Rhodes on 24/10/08 11:49, wrote:
I have a simple page the has 2 parts...
Part 1) Information at the top about a contact that the user is viewing.
Part 2) A form where a user can edit the information of a transaction
that relates to the contact.
When the user enters a invalid entry for a number field (in this
example xaction.listPrice), everything works perfectly in Part 2 of
the page (a fieldError is given and the form refilled). However, Part
1 is null since the parameterInterceptor doesn't call my action class.
How do I "refill" the Contact object information when this happens?
Or is my implementation of the Struts framework incorrect?
[SNIP]
[***test.jsp***]
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<body>
<!-- *** PART 1 *** -->
Contact Name: <s:property value="%{contact.firstName}" /> <s:property
value="%{contact.lastName}" />
<!-- *** Part 2 *** -->
<br>
<s:fielderror />
<br>
<s:form name="frmTest" action="Test_save">
<s:hidden name="xaction.xactionId" value="%{xaction.xactionId}" />
<s:textfield name="xaction.propNum" />
<s:textfield name="xaction.propStreet" />
<s:textfield key="xaction.listPrice" />
<s:submit value="Save" />
</s:form>
</body>
</html>
Well, I'm no expert on the conventional implementation of struts, so take this
with a pinch of salt, but you need to pass through all the data you use on your
page if you want it to re-appear in your form after validation failure. Try
making contact.firstName and contact.lastName hidden fields.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]