struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Mare <mjm...@webtothemax.com>
Subject RE: processPopulate() call configurable?
Date Mon, 06 Aug 2001 21:45:39 GMT
Please see comments below


> If you don't want processPopulate() to be called, just omit the form bean
> from your <action> element.
>
> > The underlying problem is that if I prefill my form, all the values are
> > overwritten by the Request objects current parameter values.
> >
> > I this something that other people have run into? Any work around?
> >
>
> If your case is what I'm thinking it is, you probably want to consider
> using different actions for prepopulating (and then displaying) a form,
> versus accepting (and processing) the form submit.
>
> Consider in the struts-example application what happens when you select
> the "Edit your registration profile" option from the main menu:
>
> * This link goes to the "/editRegistration" action, which
> * Prepopulates the form bean, and

But it does NOT create the bean and RegistrationForm.Reset() is called
because it is listed as a form bean. To circumvent this (to be able to
create the RegistrationForm oneself) it could be omitted as a form bean, but
then you wouldn't be able to get the attribute name (by calling
mapping.getAttribute())

> * Forwards to the "/registration.jsp" page to display it with
>   values from the "database".
> * Then, the form is submitted to the "/saveRegistration" action,
>   which validates the input (returning on any errors) or does
>   the appropriate database action.

The form bean's Reset() would *again* be called possibly undoing all
previous manipulations.
So is the only option to not implement a formbean Reset() method?

Why is this seemingly simple task of prepopulating a form so difficult?

Thanks

Marcel


Mime
View raw message