Newbie question:
I've managed to use Struts forms as a means of initial data entry (
registration forms etc) but have got stuck on how to use a form to update
data that already exists in a database. For example, a form where a user
can update their user details (address, email etc) and then
will be prepopulated with data for the edit
screen.
David
From: Iain Sanderson [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: HOWTO pre-populate forms with data, then update ?
Date: Thu, 23 Jan 2003 15:20:40 -0500
Newbie question:
I've
Mailing List
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject:Re: HOWTO pre-populate forms with data, then update ?
Traditionally you do this:
1. GetMyFormAction determines if it's add or edit from a query string
attribute.
2. For edit go get the info from db using the record's
putting most of this bean data into the session
scope.
-Original Message-
From: Iain Sanderson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 12:21 PM
To: [EMAIL PROTECTED]
Subject: HOWTO pre-populate forms with data, then update ?
Newbie question:
I've managed to use
]
To: Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:RE: HOWTO pre-populate forms with data, then update ?
In general, Struts applications will use prepare actions to prepare
the data for a form, and process actions to process the submitted data
for a form. In your prepare action code
, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:48 PM
To: Struts Users Mailing List
Subject: RE: HOWTO pre-populate forms with data, then update ?
In general, Struts applications will use prepare actions to prepare
the data for a form, and process actions to process
-
From: Karr, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:48 PM
To: Struts Users Mailing List
Subject: RE: HOWTO pre-populate forms with data, then update ?
In general, Struts applications will use prepare actions to prepare
the data for a form, and process actions
Iain Sanderson wrote:
David,
Thanks for your reply. How do you put the info into the form bean?
I use a action called RegistrationUpdateOpenAction to get the data from
the database and forward to the view jsp (registrationUpdate.jsp), but I
don't know how to put that data into the form bean
ObjectWave Corp.
-Original Message-
From: Iain Sanderson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 2:43 PM
To: Struts Users Mailing List
Subject: Re: HOWTO pre-populate forms with data, then update ?
David,
Thanks for your reply. How do you put the info into the form bean
, 2003 3:59 PM
To: Struts Users Mailing List
Subject: RE: HOWTO pre-populate forms with data, then update ?
Nayan,
Are you accessing the business logic ( or database) in the reset method to
determine the initial values?
Iain
Please respond to Struts Users Mailing List
[EMAIL PROTECTED
PROTECTED]]
Sent: Thursday, January 23, 2003 3:59 PM
To: Struts Users Mailing List
Subject: RE: HOWTO pre-populate forms with data, then update ?
Nayan,
Are you accessing the business logic ( or database) in the reset method to
determine the initial values?
Iain
Please respond to Struts Users
Alberto,
Perfect. And thanks, I'll give it a try. I'm sure this is what I needed to
do.
Iain.
Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:RE: HOWTO pre-populate forms with data, then update ?
You can
? Won't struts create another one?
Iain.
Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject:Re: HOWTO pre-populate forms with data, then update ?
Traditionally you do this:
1. GetMyFormAction determines if it's add or edit from a query
-
From: Karr, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 3:48 PM
To: Struts Users Mailing List
Subject: RE: HOWTO pre-populate forms with data, then update ?
In general, Struts applications will use prepare actions to prepare
the data for a form, and process actions
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 1:21 PM
To: [EMAIL PROTECTED]
Subject: Re: HOWTO pre-populate forms with data, then update ?
Struts hands you a form bean in your execute method. You cast that
variable
to your specific form type and use the setters to move data
15 matches
Mail list logo