Hello,

It is also possible by using the rowStyleClass attribute:

        <t:dataTable id="resultTable" 
                value="#{ILList.dataList}"
                binding="#{ILList.dataTable}"
                var="il"
                rowId="rowId"
                rowIndexVar="indx"
                rowOnClick="clickRow(this, #{indx});"
                styleClass="resultgrid"
                rows="10"
                headerClass="secondtitle"
                rowClasses="table-odd-row, table-even-row"
                rowStyleClass="#{il.selected ? 'table-highlight-row' :
null}"
                rendered="#{!empty ILList.dataList}"> 

Bye, Dan

-----Original Message-----
From: Henrik Bentel [mailto:[EMAIL PROTECTED] 
Sent: jeudi 26 janvier 2006 4:03
To: MyFaces Discussion
Subject: Re: dataTable and dynamic rowClasses

That worked great, thanks

-Henrik

On 1/25/06, Dennis Byrne <[EMAIL PROTECTED]> wrote:
> Try binding the dataTable element to a component instance :
>
> <h:dataTable binding="#{b.b1}" />
>
> ... where b1 is a property for a HtmlDataTable .
>
> Then, before the page is rendered, call HtmlDataTable.setRowClasses()
.
>
> Dennis Byrne
>
> >-----Original Message-----
> >From: Henrik Bentel [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, January 25, 2006 07:42 PM
> >To: [email protected]
> >Subject: dataTable and dynamic rowClasses
> >
> >Hi
> >
> >I'm looking for a way to dynamically set the style of each
> >row in a dataTable. I know how to do it statically using rowClasses
> >with a comma delimited string.
> >
> >I'm using the tomahawk dataTable and I've tried to
> >change the "rowClasses" property to an expression like so:
> >#{MyBackingBean.rowClass}
> >but that property is only resolved once when the table component is
rendered.
> >
> >What I'm looking for is a way to set the style of the current row
> >being rendered  based on the state of the current element (current
> >"var").
> >Is this possible?
> >
> >thanks
> >-Henrik
> >
>
>
>

Reply via email to