The <html:reset/> tag makes no attempt at "remembering" the original
values of the ActionForm itself, it just includes an HTML input element
of type 'reset'. All this does is to remove user edits from the current
page. IOTW, the behavior you are describing is exactly as expected.
-- Jeff
David Kennedy wrote:
Hi folks,
Three days until iteration deadline, and I have a frustrating bug! It's
almost textbook - I have a simple logon page (username/password) which
includes a <html:reset> button which works nicely ... unless I press
'submit' with known bad input and come back to the form with Validation
errors.
In that case the user can clearly see their input is somehow bad, thanks
to the message, but when I click 'reset' this time, it does nothing? The
fields continue to show the bad values.
I've only been using Struts a few days, and this feels like a FAQ, but
I've not found an answer anywhere. I've a notion the values it's
resetting too are actually the bad ones still held in the dyna bean, but
I'm not sure how to correct that.
Any ideas? Please? What is the obvious thing I'm missing?
Gory details; tomcat 5.5.4, struts 1.2.4, jdk1.5.0, red hat 7.2:
struts-config.xml:
==================
<form-beans>
<form-bean name="logonForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>
</form-beans>
...
<action path="/logon"
type="com.swanlabs.action.LogonAction"
name="logonForm"
validate="true"
scope="request"
input="logon"
unknown="true">
<forward name="success" path="/placeholder.jsp"/>
<forward name="failure" path="/logon"/>
</action>
validation.xml:
===============
<form-validation>
<formset>
<form name="logonForm">
<field property="username" depends="required">
<arg0 key="logon.label.username"/>
</field>
<field property="password" depends="required">
<arg0 key="logon.label.password"/>
</field>
</form>
</formset>
</form-validation>
logon.jsp:
==========
<html:form action="logon.do">
...
<html:reset titleKey="logon.tooltip.reset" styleClass="buttons">
<bean:message key="logon.label.reset"/>
</html:reset>
...
</html:form>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]