struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony N. Frasso" <afra...@yahoo.com>
Subject Re: Dynamically Initializing Checkbox Value
Date Wed, 30 Aug 2006 17:13:06 GMT
I guess I don't follow....

How do I prepopulate the form bean?  I have a list
page which lists all of the roles in the system.  When
the form on the list page is submitted, I can retrieve
the ID of the role that the user wants to edit.  In
the action class I then retrieve that role, and put it
into the request scope.

The question is... how do I pre-populate the form bean
with that role?  I don't have access to the form bean
yet from the action class.

Regards,
Anthony Frasso

--- Puneet Lakhina <puneet.lakhina@gmail.com> wrote:

> On 8/30/06, Anthony N. Frasso <afrasso@yahoo.com>
> wrote:
> >
> > Actually, that's incorrect.  I want to *read* from
> the
> > Role bean.  I want to *write* to the form bean.  I
> > just don't know how to go about it yet. :)  It
> seems
> > like I have to read/write to the same form bean,
> which
> > doesn't make sense, because I don't have the form
> bean
> > until I get to the JSP page, so there's no way to
> > initialize it.
> 
> 
> Actually you have probably missed the total concept
> of prepopulating. You
> put initial values in you form beans, when your JSP
> page loads your struts
> tags call the getter methods of the relevant  to put
> initial values in your
> fields. And then when the form is submitted setter
> methods are called
> followed by validate(if present and the action has
> set validate="true"), and
> in case of no errors in validate the action methods
> execute is called which
> in turn returns a forward to a page.
> 
> so your cycle for a normal form submit is like this.
> 
> request for jsp->prepoulate using getter->jsp
> rendered->submit->call
> setters->validate->if no errors ->execute of
> Action->forward
> 
> -- 
> Puneet
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message