struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: struts row rags
Date Tue, 19 Dec 2006 20:51:15 GMT
Meenakshi j wrote:
> Hello,
>   I am new to struts and would like to change the code below
>   <logic:iterate indexId="idx" id="director" name="ProposalSummaryForm" 
> property="directors">
>   <% if ( ((idx.intValue())%2) == 0 ) { %>
>                                         <tr class="evenrow">
>                                       <% } else { %>
>                                         <tr class="oddrow">
>                           <% } %>
>   </logic:iterate>
>    to style class row tags. I am not sure how to do this. Any help 
> would be appreciated.

You'd like to change the code how? Does what you have here not work? Or 
do you mean you want to get rid of the run-time expressions? If the 
latter, you may want to consider using JSTL. Something roughly like this 
may do the trick:

<c:forEach var="director" varStatus="status"
     items="ProposalSummaryForm.directors"/>
   <tr class="${status.index % 2 == 0 ? 'evenrow' : 'oddrow'}">
     ....
   </tr>
</c:forEach>

L.


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


Mime
View raw message