The default implementation of reset() doesn't actually reset any
properties. If you need it to do so, you'll have to subclass
DynaValidatorForm and override the reset() method.
Althernatively, you can clear a dyna form by clearing the Map object it
contains: form.getMap().clear().
HTH,
L.
pc leung wrote:
even the following cannot clear fields in
<form-bean name="userProfileForm"
type="org.apache.struts.validator.DynaValidatorForm" >
<form-property name="engName" type="java.lang.String" />
<form-property name="chiName" type="java.lang.String" />
DynaActionForm userProfileForm = (DynaActionForm)form;
...
userProfileForm.set("chiName", "");
userProfileForm.set("engName", "");
return mapping.findForward("success");
How can the form's fields be cleared after input successfully?
Thanks
On 11/7/05, pc leung <[EMAIL PROTECTED]> wrote:
struts-config.xml:
<form-bean name="userProfileForm"
type="org.apache.struts.validator.DynaValidatorForm" >
DispatchAction class:
DynaActionForm userProfileForm = (DynaActionForm)form;
...
userProfileForm.reset(mapping, request);
return mapping.findForward("success");
The reset function does not clear form.
How it be cleared?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]