struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From theron.kou...@webmd.net
Subject Can this be done at all using Form objects within struts framework
Date Fri, 15 Feb 2002 00:40:55 GMT

With struts,when using a Form, I'd like to be able to have the form
"pre-load" records prior to the form being displayed.
Actually, more than just that, I'd like to have a form that can be entered
in 3 different possible states:

- Insert state (in which case the form is empty)
- Edit/View state (in which I "preload" the rows from the database)
- Delete state (in which I "preload" the row from the database but have the
fields disabled).

The validation() method is great because it contains a reference to the
request object but I notice there is no "init()" or "preload()"
method that comes with the form that I could "check/set a state and
pre-load a row from the database" so that my getters would know
to use the record.

By writting a  constructor for the the form, I don't have access to the
request object.

How can this be done?     Is there a way to force the struts framework to
call a method on my form object (to load/initialize values) prior to the
form being displayed?

thanks,
Theron


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


Mime
View raw message