Patrick Casey wrote:
Thanks, the @Any tag to the rescue once again. As for it being 11:00
PM, well, that's the part of being self-employed folks don't usually
advertise :).
--- Pat
-----Original Message-----
From: Darío Vasconcelos [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 02, 2005 9:12 PM
To: Tapestry users
Subject: Re: Brain Freeze Assistence Please
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
I iterate over a search result containing authors so this is how I do it
with the Foreach component (Tapestry 3).
<bean name="evenOdd"
class="org.apache.tapestry.bean.EvenOdd"
lifecycle="request"/>
<component id="authorIterator" type="Foreach">
<binding name="source" expression="searchResult"/>
<binding name="value" expression="currentAuthor"/>
<static-binding name="element" value="tr"/>
<binding name="class" expression="beans.evenOdd.next + '
someotherclass'"/>
</component>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]