Hi all:

Is there a way to alternate row background colors within an <logic:iterate ....> tag? 
I was able to do it using java scriplet. The problem is the value of the varaible 
rowColor shows up on the JSP. Here is a snippet of the code in the JSP page:

<html>

......

<% 
 String rowColor = "#ffffff";
 String prevColor = "#ffffff"; 
 String nextColor = "#ffffcc"; 
%>

 .......

.......

<logic:iterate id="instance" name="main" property="mainInfo.titleCollection"  
type="com.acs.backend.dao.MusicDAO">   
            <tr bgcolor=<%=rowColor%>>

            <td><......></td>
             </tr>      
           
          <% if (rowColor == prevColor) { %>
          <%=rowColor = nextColor%>
          <% } else { %>
          <%=rowColor=prevColor%>
          <% } %>
                   
          </logic:iterate>
                  

 



---------------------------------
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes

Reply via email to