You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suresh MKVS <su...@gmail.com> on 2007/08/07 22:03:09 UTC

Problem with iterate tag

Hi All,
I am facing some problem with iterate tag. I am able to display data using
iterate tag, but the i am not able to regenerate the list that is used in
iterate tag. I am using the following code:

JSP Code:
   <nested:iterate name ="sureshTestForm" property ="data" id="region"
indexId="i"
    type ="com.test.Data">
    <tr class=accent>
     <td width="32%"><html:text name="region" property="zip" indexed
="true"/></td>
     <td width="10%"><html:text name="region" property="radius"
indexed="true"/></td>
    </tr>
   </nested:iterate>

Java Code :

In Form:
*private* ArrayList data = *new* ArrayList();

data contains objects of type com.test.Data,
*public* *class* Data {
*private* *int* markedForDeletion;
*private* String radius;
*private* String zip;
**
*public* *int* getMarkedForDeletion() {
*return* markedForDeletion;
}
*public* *void* setMarkedForDeletion(*int* markedForDeletion) {
*this*.markedForDeletion = markedForDeletion;
}
*public* String getRadius() {
*return* radius;
}
*public* *void* setRadius(String radius) {
*this*.radius = *radius*;
}
*public* String getZip() {
*return* zip;
}
*public* *void* setZip(String zip) {
*this*.zip = zip;
}
}
Problem example : If the data object contains 5 objects, i am able to
display 5 rows in the JSP. When I click submit on this jsp this data is
getting vanished. I am not able to recognize the changes done on screen.

Thanks,
Suresh Metla.