You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Catalin Kormos <ca...@yahoo.com> on 2005/04/22 09:54:49 UTC

how to style table rows dinamicaly?

Hi there,

I want to specify a different CSS style to different
rows in a table. The actual style class name should be
obtained from the row bean. 

The problem is that the x:dataTable tag has an
attribute "rowClasses" which can't receive a value
binding like : #{rowBeanName.styleName}
(var=rowBeanName); this seems reasonable, the row bean
is available only when rendering the actual rows,
correct?

Then, how can i give a dinamic style value for each
table row? i can't specify a background color to the
actual text displayed in each cell, but it will not
cover the entire cell space...

I'm i missing something?

Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: how to style table rows dinamicaly?

Posted by Heath Borders <he...@gmail.com>.
Currently, you cannot apply a separate style to each row in a dataTable in 
the way you want.
 The only way (kind of a hack) to do it would be to iterate through your 
collection and build a String array with all the styles you wanted for each 
row. Then, you could use the rowClasses property and bind it to that String.
 Of course, this is less efficient since it requires two passes at your 
collection, but it would work.

 On 4/22/05, Catalin Kormos <ca...@yahoo.com> wrote: 
> 
> Hi there,
> 
> I want to specify a different CSS style to different
> rows in a table. The actual style class name should be
> obtained from the row bean.
> 
> The problem is that the x:dataTable tag has an
> attribute "rowClasses" which can't receive a value
> binding like : #{rowBeanName.styleName}
> (var=rowBeanName); this seems reasonable, the row bean
> is available only when rendering the actual rows,
> correct?
> 
> Then, how can i give a dinamic style value for each
> table row? i can't specify a background color to the
> actual text displayed in each cell, but it will not
> cover the entire cell space...
> 
> I'm i missing something?
> 
> Thanks
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 



-- 
-Heath Borders-Wing
hborders@mail.win.org