1 Reply Latest reply on Nov 17, 2011 2:03 PM by Christian Peter

    RF4 rich:extendedDataTable how to change color of some rows?

    Edilmar Alves Expert

      Hi,

       

      I have a rich:extendedDataTable that it is needed to change the font color of some rows to RED in some cases, maintaining other rows with normal BLACK color. For example, when rendering:

       

      if the date column < today

         then to paint all column texts of this row with RED, to show the user that the client didn't pay the account yet

         else don't change anything in this row

       

      Is it possible?

        • 1. Re: RF4 rich:extendedDataTable how to change color of some rows?
          Christian Peter Expert

          almost anything is possible (as long as it does not break the laws of physics!) with some effort:

           

          you have to set styleClasses / css or inline styles in each of your column depending on the current value per row:

           

          <rich:extendedDataTable value="#{myBean.myList}" var="entry">

               <rich:column styleClass="#{(entry.someInteger gt 5) ? 'green' : 'red'}">

                  #{entry}

              </rich:column>

          ... for each column.

           

           

          or you set the style in your columns children: <rich:column><h:outputText value="#{entry}" style="#{..."