This whole alternating row thing is just a small part of the diplaying rows of data 
problem.  The next thing that's gonna be needed is paging, it's almost guaranteed.  
Pragmatism is great, but first you have to define the problem.




> -----Original Message-----
> From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 07, 2003 10:04 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Rendering alternate rows of a table in Struts
> 
> 
> That's all well and good but what happens when the author no 
> longer supports
> it, technology moves on, and somebody behind you has got to 
> maintain it?
> Doing it with scriptlets is as easy as
> 
> <% int count = 0 %>
> <logic:iterate . . .>
>   <% if( count % 2 == 0 ) { %>
>     <tr bgcolor="coral">
>       <td></td>
>   <% } else { %>
>     <tr bgcolor="fuscia">
>       <td></td>
>   <% } %>
>   </tr>
>   <% count++ %>
> </logic:iterate>
> 
> What could be simpler and clearer?  This methodology is much easier to
> maintain than some esoteric third-party tags.
> 
> Of course, that's just my opinion...I could be wrong.
> Eating Crow
> 
> -----Original Message-----
> From: Michael Lee [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 07, 2003 10:52 AM
> 
> There are a couple of you can't do it posts. We did it with a 
> jsp tag. One 
> of my co-workers found one on the web. Look around. There is 
> a freeware/open
> 
> source one out there he found. He may have modified it some. 
> It is very 
> possible. We did it. Sorry I can't be more help but I don't 
> know the URL.
> Mike
> 
> >From: Justin Ashworth <[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, 07 Feb 2003 09:50:36 -0500
> >
> >You can do it quite easily with JSTL...
> >
> ><c:forEach var="row" items="${tabledata}" varStatus="info">
> >
> >    <c:set var="tdclass" value="blue-row"/>
> >    <c:if test="${info.count % 2 == 0}">
> >       <c:set var="tdclass" value="red-row"/>
> >    </c:if>
> >
> >    <td class="<c:out value='${tdclass}'/>">Data</td> </c:forEach>
> >
> > > -----Original Message-----
> > > From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 07, 2003 9:35 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: Rendering alternate rows of a table in Struts
> > >
> > >
> > > No.  You have to use a scriptlet.  But remember - philosophical 
> > > purity should always yield to pragmatism.
> > >
> > > Mark
> > >
> > > -----Original Message-----
> > > From: Ritesh Singhal [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 07, 2003 9:19 AM
> > >
> > > I am using logic iterate tag to iterate over a collection and 
> > > display the contents of the collection in the form of a table. I 
> > > want to render the alternate rows with different 
> background colours. 
> > > I don't want to use scriptlet for finding the row number 
> and set the 
> > > colour. Is there any Struts tag where I can specify such 
> > > functionality.
> > >
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online  
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to