Hi Mark!

I belive that there must be a simpler solution to this. I know that I can
creata a DynaActionForm and then pupulate that by calling the set-method. So
shouldn't it be possible to create a DynaActionForm in a "populateAction"
and then put it into a "scope" with a key and then forward to the
(html)form?

Thanks in advance
Roland Carlsson




Den 04-11-11 12.26, skrev "Mark Benussi" <[EMAIL PROTECTED]>:

> Roland,
> 
> I dont know if this solution is not the approved way but I do the following.
> 
> I have a CreateForm which extends the ActionForm. It contains all the
> properties that map to the database and the validation rules.
> 
> I then have an UpdateForm which extends the CreateForm and implements its
> parents validate (If required). It can also hold data above the CreateForm
> such as the key of the data being updated....
> 
> When I want to update the data I call an action which does the following.
> 
> BeginUpdateData
> 
> Retrieves the data to be updated.
> 
> Generates an UpdateForm that represents the data.
> 
> Place in the session.
> 
> Then in the UpdateForm reset method.
> 
> I pull the UpdateForm from the session and popluate the data from itself (If
> that makes sense).
> 
> Then you can use the same pages pretty much to updated the data as it will
> be prepoluted and you also have a handle on the data you are updating.
> 
> 
> ----Original Message Follows----
> From: Roland Carlsson <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Pre-populate form
> Date: Thu, 11 Nov 2004 12:07:38 +0100
> 
> Hi!
> 
> I am looking for a better way to pre-populate my (html)forms when building
> to allow the users to edit data from a database.
> 
> I know that I can create an populate a DynaValidatorBean but I don't know
> where to put it so that I can use it from my (html)from.
> 
> Thanks in advance
> Roland Carlsson
> 
> Ps: The mail-arcive doesn't work, so I appologize if I repost something that
> already have been answerd.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to