This content has been marked as final.
Show 2 replies
-
1. Re: Highlighting rows in rich:dataTable based on the row con
ilya_shaikovsky Jan 10, 2009 7:20 AM (in response to linuxtuxie)as for me it works completely wrong even without scroller under 3.3.0.
https://jira.jboss.org/jira/browse/RF-5636
b.t.w. for h:dataTable - it works fine before and also after table pages ajax scrolling -
2. Re: Highlighting rows in rich:dataTable based on the row con
linuxtuxie Jan 14, 2009 4:39 AM (in response to linuxtuxie)I solved my own problem by implementing the following code:
Instead of generating the rowClasses attribute for the rich:dataTable tag, I generate the value for the styleClass attribute on the rich:column tag for each row. Each time the dataTable gets rerendered (due to filtering or sorting) it calls the getColor method for each cell
example:<rich:dataTable id="itemData" var="item" value="#{items}" reRender="ds" rendered="#{items.rowCount!=0}"> <rich:column styleClass="#{item.color}" sortBy="#{item.name}" filterBy="#{item.name}" filterEvent="onkeyup"> <f:facet name="header">Name</f:facet> <h:outputText value="#{item.name}" /> </rich:column> <rich:column styleClass="#{item.color}" sortBy="#{item.value}" filterBy="#{item.value}" filterEvent="onkeyup"> <f:facet name="header">Value</f:facet> <h:outputText value="#{item.value}" /> </rich:column> ... ... <f:facet name="footer"> <rich:datascroller id="ds" renderIfSinglePage="true"/> </f:facet> </rich:dataTable>
And here item.color contains the texts greenRow;redRow;... which on its turn is defined in the stylesheet