Hi! What i'm trying to obtain is somewhat described in the faqs here,
http://struts.apache.org/1.2.9/faqs/indexedprops.html , using the
struts EL extension.

This is the problem: i have an ArrayList of objects, called "list",
all of type "Type". I want to individually write on the field "field1"
of each objects in the ArrayList.

Using EL extensions, code would probably like this (i haven't tryed):

<logic.el:iterate id="idIterate" name="MyForm" property="list"
type="Type" index="index">
   <html-el:text name="MyForm" property="list[${index}].field1" />
</logic-el:iterate>

The problem i absolutely don't want to add another dependency to my
project, if not strictly necessary, and i have the sensation i can
obtain the same using only logic:iterate. Unfortunately, this:

<logic:iterate id="idIterate" name="MyForm" property="list" type="Type" >
   <html:text name="IdIterate" property="field1" />
</logic:iterate>

doesn't work, as the iteration is not "in-place", in the same property
of the bean MyForm, but probably is copied somewhere and remain in the
page context, so user written fields are lost when go on with other
pages of the form. What i want to obtain is to write directly on the
form bean properties.
I saw that from struts 1.1 exist "indexed" tags, but i'm unable to use
them, if they can give me the functionality i need.

I tryed something like:

<logic:iterate id="idIterate" name="MyForm" property="list" type="Type" >
   <html:text name="MyForm" property="list[].field1" indexed="true" />
</logic:iterate>

or similars, but it doesn't work as i expected, and in the reference
there aren't examples of use :-( . Please, can you tell me how to
obtain this using only logic:iterate (if possible)? Please note i must
use struts 1.2.9 only for my project, unfortunately.

Thanks for the help!

Francesco

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

Reply via email to