You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Au-Yeung, Stella H" <st...@eds.com> on 2004/02/24 21:17:55 UTC

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"/>&nbsp;</td>
  <td class="formCell"><bean:write name="parts" property="'partDescription'
"/>&nbsp;</td>
  <td class="formCell">
       <a href="app/fdd/shopWorkOrder/UpdatePart.exec?index=<How to
reference the index here????>">
          <img src="images/iconEdit.gif"></a>&nbsp;

    </td></tr>
</logic:iterate>

Thanks in advance!

Stella

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: A question on Struts taglib.

Posted by Shyam A <st...@yahoo.com>.
You can use the indexId attribute of <logic:iterate>
tag...
http://jakarta.apache.org/struts/doc-1.0.2/struts-logic.html#iterate

HTH,
Shyam

--- "Au-Yeung, Stella H" <st...@eds.com>
wrote:
> 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"/>&nbsp;</td>
>   <td class="formCell"><bean:write name="parts"
> property="'partDescription'
> "/>&nbsp;</td>
>   <td class="formCell">
>        <a
>
href="app/fdd/shopWorkOrder/UpdatePart.exec?index=<How
> to
> reference the index here????>">
>           <img src="images/iconEdit.gif"></a>&nbsp;
> 
>     </td></tr>
> </logic:iterate>
> 
> Thanks in advance!
> 
> Stella
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org