problem with indexed property

Hi,

Im using struts...

I have:

<logic iterate... name="myForm" property="myList" type="MyObj" indexId="i" id="object">

<html:text name="object" property="<%= "myList[" + i + "].id" %>" />

</logic:iterate>

And in myForm i have

public Object getMyList(int index) {

}

With these parameters, method getMyList isn't invoked, is invoked getMyList().

If i change so:

<html:text name="object" property="<%= "myListNew[" + i + "].id" %>" />

Method myListNew(int index) is invoked.

Isn't possible iterate in a list and set property on the same object, i have to need use other name ?

Thanks, Davide.

[719 byte] By [davide.angela] at [2007-11-27 8:35:00]
# 1

<logic iterate name="myForm" property="myList" indexId="i" id="Obj">

<input type="text" name="Obj[<bean:write name='i'/>].id" />

</logic:iterate>

In you action form write a getter / setter for Obj

List myList = new ArrayList();

//getter/setter for myList

and

public MyObj getObj(int index){}

public void setObj(int index,MyObj obj){

// handle the index for a valid range

}

R@njita at 2007-7-12 20:31:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...