struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: [Nested] Order of Population of nested properties
Date Mon, 02 Jun 2003 11:41:48 GMT
Yeh. There is no gaurantee on the order of population. :-(

If you must do your thing in the setter then you can use request.getPara...
hmm oops! no you cant. You dont have access to the request object there!

If its not a multipart form you could do it in the reset() method and use
request.getParameter() to obtain the values you need but I wouldnt normally
recommend that (unless of course you had _already_ created the new rows and
fields on the client side using javascript DOM programming - in which case
you need to create those beans before population occurs!)

I had to do something similar in my app (simple add rows on submit (no
client side funny business)) so I put the relevant code in the Action that I
was submitting to - which simply checks if the "addMoreStuff" property was
set and adds the necessary rows before forwarding back to the view - (or
takes other action if it wasnt).

-----Original Message-----
From: Affan Qureshi []
Sent: Monday, 2 June 2003 19:35
To: struts-user
Subject: [Nested] Order of Population of nested properties

I have an implementation just like the monkey-tree example where I have a
button to add more fields in a form dynamically. The button is a Submit
button which is mapped to a nested bean's property. By default the the
button adds one set of nested (recursively) fields. I want it to add
user-defined no of rows. For that I have a text field mapped to another
property of the same nested bean. I get that value and add the specified no
of rows. It works fine but sometimes I get the following problem.

Sometimes properties are populated before the other which causes great
confusion. E.g if the 'noOfFieldsToAdd' property is populated after the
'addMoreFields' (the button) property I wont get the correct output. Also I
see that some properties are populated twice instead of once which is also a
bit confusing.

Is there any order in which the fields are populated? Can i control this? Or
maybe I am using it in the wrong way?

Thanks a lot.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message