struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: reset method with DyanValidatorForm
Date Wed, 01 Nov 2006 23:26:38 GMT
Woops, sorry download link should have been:

http://struts.apache.org/downloads.html

On 11/1/06, Niall Pemberton <niall.pemberton@gmail.com> wrote:
> On 11/1/06, fea jabi <zyxrm@hotmail.com> wrote:
> > 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?
>
> Its in the Struts 1.3.x series - the only "ga" (or production) quality
> version is Struts 1.3.5 - so if you were looking to upgrade from 1.2.x
> - that is currently the best option. You can download it here:
>   http://download.java.net/jdk6/docs/api/
>
> Notes on Upgrading to 1.3.x are here:
>   http://wiki.apache.org/struts/StrutsUpgrade
>
> Niall
>
> > >From: "Niall Pemberton" <niall.pemberton@gmail.com>
> > >Date: Wed, 1 Nov 2006 15:35:44 +0000
> > >
> > >On 1/6/06, Wendy Smoak <wsmoak@gmail.com> wrote:
> > >>On 1/6/06, fea jabi <zyxrm@hotmail.com> 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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message