You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eddie Fung <ig...@netspace.net.au> on 2001/12/04 12:40:09 UTC

iterate tag problems (sorry !!)

I've looked through the archives regarding the iterate tag and have
followed all the suggestions on use of the <iterate> tag but still have a
problem getting the form data to be updated. Yes I do have a 
getParameter(int index)
method but I still can't get the data updated in the form.

I have:

<logic:iterate name="myForm" id="myObject" type="com.fred.data.myObjectBean"
            property="myObjectArray"  indexId="index">

    <html:checkbox name="myObject" property="beanSelected" value="true" 
indexed="true"/>

    <html:text name="myObject" property="postDay" size="2" maxlength="2" 
indexed="true"/>
     /
    <html:text name="myObject" property="postMth" size="2" maxlength="2" 
indexed="true"/>
     /
    <html:text name="myObject" property="postYear" size="4" 
maxlength="4"indexed="true"/>

</logic:iterate>

Where myForm = my ActionForm class

       myObjectArray is an ArrayList of myObjectBean objects

I have the following defined in the myForm ActionForm:

private ArrayList myObjectArray;

public ArrayList getMyObjectArray()
{
     return myObjectArray ;
}

public void setMyObjectArray (ArrayList anArray)
{
     this.myObjectArray = anArray;
}

public myObjectBean getMyObject (int index)
{
     return (myObjectBean) getMyObjectArray.get(index);
}

The myObject class has public getters and setters for all fields.

I can render the page but if I change the beanSelected, postDay, postMth or 
postYear
fields the changes are not reflected in the Form.

BTW Dave Hay how does Struts match up the getMyObject method with the 
myObjectArray ??

TIA

Eddie





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>