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
:-).