Just a suggestion,

If you do the rows by javascript you can add a hidden field which can have a value (eg 0 for update 1 for creation)

Regards,
Kevin
----- Original Message ----- From: "Andrew Tomaka" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, July 27, 2005 9:47 PM
Subject: [OT] Create/Edit Form


Hey all,

The following is pretty hard to understand.  I'm no good at describing
my problems and wasn't sure how to explain it.  Hopefully, someone
will get what I'm attempting to say

I'm working on a screen that allows a user to dynamically add rows via
Javascript. I then have have a form that contains a list of beans that
stores the data (but that's really beside the point).

My issue comes with the storage of this information.  The form can
either be a blank form or it can be preloaded with other information
depending on whether the record exists or not.  If it is preloaded,
the user can edit the existing rows or add new rows.  The problem
comes when I need to update the database.  When the user hits the save
button, it submits all the information, but I have no way of telling
if a specific row was edited or created. Because of this, I don't know
whether to make an UPDATE query or an INSERT query.  Can anyone think
of a creative way to do this without adding an extra query for each
row?

Any insight would be greatly appreciated!

Thanks,
~ Andrew Tomaka

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





--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/2005





--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 25/07/2005


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

Reply via email to