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 id you passed in the
query string.
3. Put that info into your form bean.
4. Forward to your form
The form's input elements will
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
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, you'll interface with your
business logic to obtain the required data, then populate fields of a
bean, probably in
]
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
14 matches
Mail list logo