Without going into "why would you want to set them to false" I'd urge you to use your 
action.  This way, the logic isn't coupled with the bean but with the action that 
presents it.

I would give serious thought into whether you actually need to do any such thing at 
all.....however, you know your business needs better so....

Sri

-----Original Message-----
From: Rick Reumann [mailto:maillist@;reumann.net] 
Sent: Monday, November 04, 2002 3:00 PM
To: Sri Sankaran
Cc: Struts-User
Subject: Re[4]: Nested Tags situation any light would be appreciated




On Monday, November 4, 2002, 2:33:26 PM, Sri wrote:


SS> Rick: I think the problem is in how you are initializing your
SS> objects. In particular the problem is where you call the
SS> setCarList() method. Both Persons are getting a reference to the 
SS> same list. In other words you have only one car list in memory. So, 
SS> when you modify it, you are modifying the car list for both persons.

SS> Make sense?

    Ahh yes it most certainly does. Thanks! I should have caught that.
    In trying to be quick and dirty for this example I screwed up.

SS> Aside: Try not to initialize your bean in the reset() method. It
SS> gets called each time the form is submitted before Struts sets the 
SS> values the user provided. Can you somehow, move that logic to the 
SS> Action class?

    Actually I was just doing it all in the reset to figure out where
    I was screwing up. The problem is it appears that I do have to do
    some of this in the reset method since initially I was working on
    this example using check boxes and I realized I have to reset the
    car objects boolean property to false. What's the best way to go
    about this? In other words say you are working on an example where
    you have objects pretty deeply nested and one of the Lists deeply
    nested has objects in it where you need to work with checkboxes
    for the boolean properties. Don't I have to end up creating the
    whole nested hierarchy all over again just to make sure these
    boolean properties are reset to false? What's the best way to
    tackle this situation?

    Thanks so much for the help so far.



-- 

Rick
mailto:maillist@;reumann.net


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to