My problem isn't figuring out if the row is an odd or an even row
:). My problem is doing something with that knowledge, specifically setting
the class of an enclosing span based on the value thereof.

        If I know I'm on an even row (which I do), how do I set the class to
"even" so I can color it via css?

        -- Pat



> -----Original Message-----
> From: Muralidhar Y. [mailto:[EMAIL PROTECTED]
> Sent: Sunday, October 02, 2005 9:02 PM
> To: 'Tapestry users'
> Subject: RE: Brain Freeze Assistence Please
> 
> I am not sure whether this can help u or not but this bean in tapestry
> also
> does what u are trying to do. May be it can help you just have a look.
> 
> "org.apache.tapestry.bean.EvenOdd"
> 
> 
> Muralidhar Y
> Software Engineer,
> Adastrum technologies-Nikai groups,
> EmiratesGroup-I.T Division,
> Dubai, UAE.
> Mobile : 00971-50-2256149.
> http://www.adastrumtech.com
> http://www.mercator.aero
> (Keep Smiling. Be happy All The Time.)
> 
> -----Original Message-----
> From: Patrick Casey [mailto:[EMAIL PROTECTED]
> Sent: 03 October 2005 07:51
> To: 'Tapestry users'
> Subject: Brain Freeze Assistence Please
> 
> 
> 
>             Hi Folks,
> 
> 
> 
>             For some reason my brain is locking up on what I'm sure is
> mind
> numbingly simple.
> 
> 
> 
>             I have a component template that renders a number of rows of
> data.
> 
> 
> 
>             For even rows, I want to enclose to row in a
> 
> <span class="even">ROW</span>
> 
> 
> 
> For odd rows, I want to enclose the row in a
> 
> <span class="odd">ROW</span>
> 
> 
> 
> I have a parameter I pass into the component that tells it where or not it
> is even.
> 
> 
> 
> How do I conditionally set the class attribute (or any attribute) for that
> matter? I know I can do:
> 
> 
> 
> <span jwcid="@Conditional" condition="ognl:even">
> 
> <span class="even">ROW</span>
> 
> </span>
> 
> 
> 
> <span jwcid="@Conditional" condition="ognl:odd">
> 
> <span class="odd">ROW</span>
> 
> </span>
> 
> 
> 
> But I *really* don't want to duplicate my row rendering code because it's
> very, very large, and quite volatile so I don't want to have to duplicate
> every possible future change.
> 
> 
> 
> So what's the way to conditionally set an attribute?
> 
> 
> 
> --- Pat
> 
> 
> 
> PS Bonus points if you can explain why I'm brain freezing so hard over
> this
> :-).




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

Reply via email to