Toggle taglib ver. 1.3

    Custom JSP taglib lets you implement rotated text. With this tag you can provide some alternating values in your code. For example:

<%@ taglib uri="taglib.tld" prefix="t" %>

<% for (int i=1; i<=5; i++) { %>
  <tr bgcolor=<t:toggle>'green'|'yellow'</t:toggle> > ... </tr>
<% } %>

here <t:toggle>'green'|'yellow'</t:toggle> will swap values from the given list (green, yellow) within your loop so for the each row in your table you will have own background color.

For your toggle switch you can provide also a constant part (prefix). E.g.:

<t:toggle prefix="<tr bgcolor=">'green'|'yellow'</t:toggle>

also your list of alternating values could be provided as a parameter (suffix). E.g.:

<t:toggle suffix="'green'|'yellow'"/>

Tags are:


Body tag rotates a text. Parameters are:

1) id Optional parameter. Describes an unique name for this toggle switch. You must use this parameter if you have more than one switch on the page.
2) prefix Optional parameter. Describes a constant part of output.
3) suffix Optional parameter. Provides a list of alternating values (separated by |). Alternatively you can provide list of values as a body for this tag.

for downloading:

Library: toggletag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: