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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- 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]