Try this: <logic:iterate id="parts" indexId="index" collection="<%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()%>" type="com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean"></td> <tr> <td class="formCell"><bean:write name="parts" property="partNumber"/> </td> <td class="formCell"><bean:write name="parts" property="'partDescription' "/> </td> <td class="formCell"> <a href="app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=update&partInd ex=<%=index%>"> <img src="images/icoEdit.gif"></a> </td> </tr> </logic:iterate>
If you can use JSTL, this may work for you, assuming ShopWorkOrderFormBean named shopWorkOrderForm in some scope: <c:forEach var="item" items="${shopWorkOrderForm.shopWorkOrder.partList}" varStatus="status"> <tr> <td class="formCell"><c:out value="${item.partNumber}"/></td> <td class="formCell"><c:out value="${item.partDescription}"/></td> <td class="formCell"> <a href='app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=update&partIndex=<c:out value="${status.index}"/>'><img src="images/icoEdit.gif"></a> </a> </td> </c:forEach> robert > -----Original Message----- > From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 6:12 PM > To: 'Struts Users Mailing List' > Subject: RE: A question on Struts taglib. > > > I changed my code to use "indexId" and got the following error: > > symbol : variable indexId > location: class jsp_servlet._app._fdd._shopworkorder.__createshopworkorder > > out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ > /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] > > > Here's the changed code: > <logic:iterate id="parts" indexId="index" > collection="<%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()%>" > type="com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean"></td> > <tr> > <td class="formCell"><bean:write name="parts" > property="partNumber"/> </td> > <td class="formCell"><bean:write name="parts" property="'partDescription' > "/> </td> > <td class="formCell"> > <a > href="app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=update&partInd > ex=<%=indexId%>"> > <img src="images/icoEdit.gif"></a> > </td> > </tr> > </logic:iterate> > > Any Idea? What did I do wrong? > > -----Original Message----- > From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 3:45 PM > To: Struts Users Mailing List > Subject: RE: A question on Struts taglib. > > > add index attribute in your logic iterate and append that index to your host > string. > > e.g > <logic:iterate id="xyzID" name="xyzForm" property="xyz" indexId="index" > > yourhoststring+<%=indexId %> > </logic:iterate> > > -R > > > -----Original Message----- > From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 3:18 PM > To: [EMAIL PROTECTED] > Subject: A question on Struts taglib. > > > A question on Struts taglib. > Can someone tell me how to reference the "index" of each element so I can > pass it as a parameter with the <a href> path string? > > For example I have the following code, I want to print out 'partNumber' and > 'partDescription' and a <a href'> with index of each element'. > > <logic:iterate id="parts" > collection="<%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()%>" > type="com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean"></td> > <tr> > <td class="formCell"><bean:write name="parts" > property="partNumber"/> </td> > <td class="formCell"><bean:write name="parts" property="'partDescription' > "/> </td> > <td class="formCell"> > <a href="app/fdd/shopWorkOrder/UpdatePart.exec?index=<How to > reference the index here????>"> > <img src="images/iconEdit.gif"></a> > > </td></tr> > </logic:iterate> > > Thanks in advance! > > Stella > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]