How is this:

<jsp:useBean id="rowToggler"class="com.mycompany.RowToggler"/>
<tr class="<bean:write name="rowToggler" property="value"/>" />

easier to understand than this:

<tag:tr>
<td></td>
</tag:tr>

It's truly amazing that people are still advocating confusing scripting over easy tags.

David


From: "Dennis Doubleday" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: Rendering alternate rows of a table in Struts
Date: Fri, 7 Feb 2003 15:01:10 -0500

I just created a RowToggler class with a getValue() method that returns
an alternating value each time you call it. Then, in JSP, I do:

<jsp:useBean id="rowToggler"class="com.mycompany.RowToggler"/>

and on each table row:

<tr class="<bean:write name="rowToggler" property="value"/>" />

which gives alternating rows different CSS class names. This especially
works better than scripting if the data in the rows of the table aren't
things that you can iterate through. Put 10 different things in the
table, reorder them, it doesn't matter.

And MUCH easier than a custom tag.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to