You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Dawn <pe...@gmail.com> on 2006/07/04 06:21:26 UTC
Alternate row colours again
hi guys,
last week i got the alternate colours to work within my foreach
component with the help of Murray and Jesse, but I have run into the
same problem again.
now on another page, I have another foreach leap which displays a
table. now within this foreach loop i am already using a class tag
(class="ognl:rowClass") and hence i cannot use another class tag for
alternate colours (class="ognl:rowStyle"). i might try the bean method
but again i would need to use the class element which i have already
used up.
is there another way around. sorry guys for repeating the problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Re: Alternate row colours again
Posted by Sam Gendler <sg...@ideasculptor.com>.
Don't forget that html does allow multiple classes to be assigned to
an element, so another way to solve it is to just construct a string
containing multiple class names in the method referenced by the class
binding. You can still use the EvenOdd bean, but you must call next()
on it yourself, and insert the return value into your class string.
--sam
On 7/4/06, Nick Westgate <ni...@key-planning.co.jp> wrote:
> Hi Peter.
>
> It looks like you are using some kind of variable called rowClass,
> so in this case you could use two such variables. Something like:
>
> class="ognl:(rowIndex % 2) == 0 ? rowClassEven : rowClassOdd"
>
> where rowIndex is an int property passed to the Foreach index param.
>
> Or you can do something similar in an additional "style" tag which
> overrides the background colour of the class.
>
> Cheers,
> Nick.
>
>
> Peter Dawn wrote:
> > hi guys,
> >
> > last week i got the alternate colours to work within my foreach
> > component with the help of Murray and Jesse, but I have run into the
> > same problem again.
> > now on another page, I have another foreach leap which displays a
> > table. now within this foreach loop i am already using a class tag
> > (class="ognl:rowClass") and hence i cannot use another class tag for
> > alternate colours (class="ognl:rowStyle"). i might try the bean method
> > but again i would need to use the class element which i have already
> > used up.
> >
> > is there another way around. sorry guys for repeating the problem.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Alternate row colours again
Posted by Nick Westgate <ni...@key-planning.co.jp>.
Hi Peter.
It looks like you are using some kind of variable called rowClass,
so in this case you could use two such variables. Something like:
class="ognl:(rowIndex % 2) == 0 ? rowClassEven : rowClassOdd"
where rowIndex is an int property passed to the Foreach index param.
Or you can do something similar in an additional "style" tag which
overrides the background colour of the class.
Cheers,
Nick.
Peter Dawn wrote:
> hi guys,
>
> last week i got the alternate colours to work within my foreach
> component with the help of Murray and Jesse, but I have run into the
> same problem again.
> now on another page, I have another foreach leap which displays a
> table. now within this foreach loop i am already using a class tag
> (class="ognl:rowClass") and hence i cannot use another class tag for
> alternate colours (class="ognl:rowStyle"). i might try the bean method
> but again i would need to use the class element which i have already
> used up.
>
> is there another way around. sorry guys for repeating the problem.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org