Andrew-

At some point, you're probably going to need to know which records
have been changed and which ones haven't. If the dataset isn't too
big, you could add a collection (java.util.List, etc.) of records that
you are displaying, and store it either as a formbean attribute or in
the session. If these records and/or lists are big, you will run into
problems with either method, but then is a user really going to want
to be able to edit hundreds of records anyway?

-ed

On 7/27/05, Simons Kevin <[EMAIL PROTECTED]> wrote:
> 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]
> 
>

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

Reply via email to