Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] Using Struts Tag to create HTML tag

Tim Azzopardi

2007-02-28

Replies:


This works for me: set a request scope variabe with s:set and then use a jstl
expression like ${zi}
You should be able to use ${zi} pretty much anywhere.
Don't know if there is a more strutsy way of doing it but it works for me.


e.g.

<s:iterator value="collectionOnAction" status="status">

 <tr>
   <s:set name="zi" value="#status.index" scope="request"/>

   <s:textfield name="collectionOnAction[${zi}].internalComments"
id="prLines${zi}.internalComments"value="%{internalComments}" />
 </tr>
</s:iterator>



Roger Varley wrote:
>
> Hi
>
> I'm using the <s:iterator> tag with the status attribute to get the
> iterator count. From this I want to dynamically construct an HTML tag
> <div class="columnX"/> where X is the value of the iterator status
> count. Can I actually do this and if so, how or do I need to provide
> this information from my action class
>
> Regards
> Roger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.