struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scherger, Derek" <>
Subject RE: Logic:iterate with html:text indexed properties
Date Thu, 15 Apr 2004 14:19:03 GMT
I don't follow you... 

I am using nested beans and they aren't getting values set on them. The path
being used in the call to BeanUtils.populate doesn't have the required
prefix and this is because I'm using the property exported by the iterator.

-----Original Message-----
From: Takhar, Sandeep [] 
Sent: Thursday, April 15, 2004 5:35 AM
To: Struts Users Mailing List
Subject: RE: Logic:iterate with html:text indexed properties

You can manually create the property or use nested beans.


-----Original Message-----
From: Scherger, Derek []
Sent: Wednesday, April 14, 2004 5:33 PM
To: ''
Subject: Logic:iterate with html:text indexed properties

I'm having a bit of a problem with the html:text tag in an indexed
my form bean is arranged as follows:

	InnerBean aaa;
	InnerBean bbb;

	List list;

	String name;
	Integer value;

Where the elements of the InnerBean list are SimpleBean's. On my jsp page I
have the following, inside of and html:form tag.

<logic:iterate id="simple" name="formBean" property="aaa.list"
<html:text name="simple" property="value" indexed="true"/>

The html that gets generated by this has text inputs named simple[0].value,
simple[1].value etc..
When this is submitted it's trying to set these indexed values directly on
the formBean rather than on the proper inner bean's list. i.e.
BeanUtils.populate(formBean, {simple[0].value=123, simple[1]=456})

I'm thinking of addint a getSimple(int index) method to my form bean to
return the indexed element from aaa.list but this seems like somewhat of a
hack. It seems that the html:text tag needs some way of generating inputs
with a prefix to the specified name, in my case aaa.list so that the inputs
are named "aaa.list.simple[0].value" etc.

Is there a better way to handle situations like this, or does my form bean
need to be less structured to work properly?


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

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

View raw message