You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by suhas <su...@techmas.hcltech.com> on 2001/07/10 11:55:17 UTC

Iterate problem

Hi I have a question 

My Iterate tag goes like this 

<logic:iterate id="view" name="updateOrderForm" property="views" type="example.testorder.OverDueOrderView">

<tr>
<td>
<html:text property='<%= "view[" + index+ "]"+".orderNo" %>' /> 
</td>
<td>
<html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
</td>
<td>
<html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
</td>
</tr>
<% index++ ;%>
</logic:iterate>

Do I need **IndexId** here as an attribute in the iterate Tag  ??? 'cos In my form bean when showing the above table there is a call to 

 public OverDueOrderView getView(int index) {
      System.out.println(" in side the getView of UpdateOrder Form "+ index);
  return (OverDueOrderView)views.get(index);
 }

Here I'm getting **in side the getView of UpdateOrder Form 0 **  printed with following error message 
     javax.servlet.ServletException: Exception thrown by getter for view[0].orderNo of bean org.apache.struts.taglib.html.BEAN

What can be the problem -- IS it 'cos i'm not specifying indexId attribute in the iterate tag or something else ???