Editing a pre-filled in form
1 posts in topic
Flat View  Flat View

Posted By:   Paul_Hunnisett
Posted On:   Tuesday, February 17, 2004 01:31 AM

I want to have a form where registered users can edit their details.

This means the form has to be pre-populated with the users data. Do I simply need to set the values of the form bean from the DB in advance to do this? If so, how do I do that?

If I'm way off track - can someone give me some clues Please? This is the last thing I need to do to get my web app running!

Re: Editing a pre-filled in form

Posted By:   Matan_Amir  
Posted On:   Tuesday, February 17, 2004 02:17 AM

Hi Paul,

It's actually pretty simple. If you already have the actionform that you used for registration (like a userform for example), set the edit details action to use it (

Then in the action itself populate the form with all the values you need.

In the jsp page use the struts tags for the form fields - then it should all be filled up properly.

Another "dirty" solution is to extend your user action form (call it updateuserform for example) and override the reset function. In the reset function, set all the values you want to show. Then in the action, use that update form.

That is basically instead of updating the form in the action itself, but go with the first solution if you can.

Hope that helps,

About | Sitemap | Contact