or:
<span jwcid="@Any" class="ognl: even ? 'evenClass' :
'oddClass'">....</span>
On Oct 3, 2005, at 12:11 AM, Darío Vasconcelos wrote:
instead of your
boolean getEven( )
method, create a
String getCSSClass( )
that will return the class name directly, depending on whether the row
is even or odd:
<span jwcid="@Any" class="ognl:CSSClass">....</span>
As to why your brain is locked, well, it's Sunday, 11:00 PM,.. that
pretty much explains it :-)
On 10/2/05, Patrick Casey <[EMAIL PROTECTED]> wrote:
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
:-).
--
I have enough money to last me the rest of my life, unless I buy
something.
Jackie Mason
---------------------------------------------------------------------
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]