On 1/6/06, Wendy Smoak <[EMAIL PROTECTED]> wrote:
On 1/6/06, fea jabi <[EMAIL PROTECTED]> wrote:

> So, I might have to reset the checkboxes now.
>
> Do, I have no other choice but to create a formbean Class with all the
> setter's and getter's and then add reset method too for it.
>
> or is there an easier way to do this using DynaValidatorForm?

You don't have to add the get/set methods.  Just extend
DynaValidatorForm and add the reset method -- then be sure to change
the type of the form in struts-config.xml to your new form type.

package com.example.myapp;
public final class AccountForm extends DynaValidatorActionForm
implements Serializable {...}

       <form-bean
            name="accountForm"
            type="com.example.myapp.AccountForm">

Hubert added a new feature in Struts 1.3.x that allows you to
configure "reset" behaviour on a property-by-property basis in the
struts-config.xml - I believe you just  add reset="true" attributes to
your <form-property> elements and it will reset the values to whatever
is (or isn't) specified by the "initial" attribute. Something like the
following:

<form-beans>

   <form-bean  name="fooForm" type="org.apache.struts.action.DynaActionForm">
       <form-property name="state"  type="java.lang.String"
initial="INITIAL" reset="true"/>
       <form-property name="unsubscribe" type="java.lang.String"
initial="true" reset="true"/>
   </form-bean>

 </form-beans>

Niall

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to