struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <>
Subject Re: [FORMDEF] Resetting booleans for session-scoped dynaforms
Date Wed, 12 Oct 2005 17:38:16 GMT
Wow, you've got good timing, because someone is calling for this very
feature in FormDef, patch provided:

The quick answer to your question is "no".  FormDef doesn't meddle
with how Struts populates the form.  It's more of a utility class you
call in your Action.  The approach the patch takes is to use subclass
DynaActionForm to override reset() so the checkbox fields can be reset
to false.

My reservation with this approach is, the patch targets only
DynaActionForm.  We'd have to apply the same thing for the five or six
other dyna forms.  I brought this up on the dev list but
the issue didn't get anybody's attention.  I think this problem is
best solved on the Struts core.

Maybe we can do something like this when configuring forms:
        type="java.lang.String" />
        type="java.lang.String" />

I'll bring it up again and see what happens.


On 10/12/05, Michael Jouravlev <> wrote:
> If Struts is about community and bringing people and Struts-related
> tools together, not about one particular product anymore, then I'd ask
> this question right here.
> The question is inspired by katre's interest in checkboxes inside
> dynaforms. I guess, there should be no problem with request-scoped
> dynaforms, but session-scoped forms need to clear their
> checkbox-related fields right before a form is populated.
> Hubert, is it possible to add a feature in FormDef, which would allow to:
>   * either clear all boolean fields when request comes;
>   * or to clean only selected fields;
>   * to choose, when to do the cleaning: for all types of requests,
>     or for particular ones, like either POST or GET.
> Something like this:
> <form name="sampleForm" beanType="">
>   <field property="contactMe"
>     getter="getContactMe"
>     setter="toggleContactMe"
>     reset="POST, GET"/>     <=== Can be just "POST"; resets value to false
> </form>
> Currently, I need to clean the booleans for POST request only, this is
> when input comes. I do not need to clean form on GET, this is when the
> form is just displayed.
> I would like to start using FormDef in my project.
> Michael J.
> --
> Struts Dialogs

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message