I would suggest you use nested beans 

Regards
Rohit

-----Original Message-----
From: Riaan Oberholzer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 7:14 PM
To: [EMAIL PROTECTED]
Subject: Can I do multiple updates/inserts with one struts form?

I have a dynamic table with a list of entries. Every
row can be changed in one view and when the user
submits it, everything is updated at once.

How can I do this with struts? Rendering form elements
with struts requires a property, but since I use
multiple rows, all with the same property name (as a
prefix, the unique id (can be text also) of the row
forms the suffix), this cannot be done in a struts
form. How do I do it?

I currently used pure HTML for this and generated the
names of the fields by adding the unique key value of
the row. The rows names would look like this:

nameXXX   salaryXXX   addressXXX
nameYYY   salaryYYY   addressYYY

etc. My processing action now has to run through ALL
the parameters sent and figure it out with something
like:

  if (param.startsWith("name") {
      id = param.substring(4);
      salary = request.getParameter("salary" + id)
      // etc, until you have the complete record 
      // then update the record

Is there a better way do to this? And can it be done
with struts forms?



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



*----------
This message and any attachment(s) is intended only for the use of the addressee(s) 
and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the 
intended addressee(s), you are hereby notified that any use, distribution, disclosure 
or copying of this communication is strictly prohibited. If you have received this 
communication in error, please erase all copies of the message and its attachment(s) 
and notify the sender or Kanbay postmaster immediately.

Any views expressed in this message are those of the individual sender and not of 
Kanbay.

Although we have taken steps to ensure that this e-mail and any attachment(s) are free 
from any virus, we advise that in keeping with good computing practice the recipient 
should ensure they are actually virus free.


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

Reply via email to