You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/10/19 21:13:00 UTC

Getting an id in a Foreach

I'm trying to get the html id attribute set on a table cell. I would like
that id to be based on something generated by Tapestry. I've tried the
following because I though that the jwcid would output an id on the table
cell.

<tr jwcid="@Foreach" ...>
<td jwcid="myid@Any" element="td">

</td>
</tr>

I thought that the td would all have id's like myid, myid$0, myid$1, etc...
However, as the experts already know, this is not so. 

Does anybody have any suggestions about how to accomplish this?

The goal is to be able to find table cells in the HTML returned by the
Tapestry application to httpunit.

Richard


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


Re: Getting an id in a Foreach

Posted by Paul Ferraro <pm...@columbia.edu>.
Try using the index property of the Foreach component:

<tr jwcid="@Foreach" index="ognl:index" ... element="tr">
    <td jwcid="@Any" id="ognl:'myid' + index">...</td>
</tr>

Paul

Hensley, Richard wrote:

>I'm trying to get the html id attribute set on a table cell. I would like
>that id to be based on something generated by Tapestry. I've tried the
>following because I though that the jwcid would output an id on the table
>cell.
>
><tr jwcid="@Foreach" ...>
><td jwcid="myid@Any" element="td">
>
></td>
></tr>
>
>I thought that the td would all have id's like myid, myid$0, myid$1, etc...
>However, as the experts already know, this is not so. 
>
>Does anybody have any suggestions about how to accomplish this?
>
>The goal is to be able to find table cells in the HTML returned by the
>Tapestry application to httpunit.
>
>Richard
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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