you could use hidden variables on your jsp page to store the VO attributes
you are not changing and keep your VO intact only changing the 5 fields

-----Original Message-----
From: Brian McSweeney [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 02, 2003 11:05 AM
To: 'Struts Users Mailing List'
Subject: RE: newbie: Best Practice Struts/Value-Objects?


Hi Darren,
I was under the impression that it works exactly the way you hope it
does.
Actually I'm pretty sure it does.
Also what might be worth looking at ( I have to look at it myself ), is 
Light-value-objects where you only populate the initial value object
with the 5 fields rather than the whole 20. This is obviously more
optimal in 
terms of db queries.

This is all pre-supposing you are using xdoclet and EJBs and xdoclet,
which
perhaps you are not.

HTH,
Brian

-----Original Message-----
From: Darren Hartford [mailto:[EMAIL PROTECTED] 
Sent: 02 October 2003 13:41
To: [EMAIL PROTECTED]
Subject: newbie: Best Practice Struts/Value-Objects?

Hi all!
Been working with struts and value-objects, and I am beginning to
understand the power of these two in combination. I did however run into
a snag that may be either on purpose or just ignorance on my part.

If I pass a 20-field value-object to an ActionForm (let's say an
EmployeeVO), and I only show the employee's name and address for editing
(only 5 or so fields).  They make the necessary changes and submit the
form.  What I understand is the form will populate a NEW EmployeeVO and
not make the changes to the original EmployeeVO, thereby creating an
EmployeeVO populated only from the 5 fields on the form and nulling the
other 15 fields.

I was hoping to take an existing Value-Object, only make necessary
changes from the submitted form (i.e. 0-5 changed fields and the other
15 stay the way they are), and then re-submit the Value-Object for
updating the DB, but that does not seem possible.  Am I doing something
wrong and/or mis-understanding the best utilization of Value-Objects
with Struts?  Again, I'm a newbie so any pointers, help, or examples
would be great!

thanky in advance!
-D

---------------------------------------------------------------------
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]

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

Reply via email to