Thanks. This forum has been great help to me.

we are using 1.2.7 so, can't use this nice feature yet.

But where can I get the new features added after 1.2.7 version from?


From: "Niall Pemberton" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: reset method with DyanValidatorForm
Date: Wed, 1 Nov 2006 15:35:44 +0000

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]


_________________________________________________________________
Get FREE company branded e-mail accounts and business Web site from Microsoft Office Live http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/


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

Reply via email to