There is a parallel discussion that gave a good link:

http://jakarta.apache.org/struts/faqs/indexedprops.html

I was talking about the nested tag library.

sandeep

-----Original Message-----
From: Scherger, Derek [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 10:19 AM
To: 'Struts Users Mailing List'
Subject: RE: Logic:iterate with html:text indexed properties


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 [mailto:[EMAIL PROTECTED] 
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.

sandeep

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


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

FormBean
        InnerBean aaa;
        InnerBean bbb;

InnerBean 
        List list;

SimpleBean 
        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"
type="SimpleBean">
<html:text name="simple" property="value" indexed="true"/>
</logic:iterate>

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?

Thanks,
Derek






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