How to conditionally style a row in a rich:dataTable

后端 未结 7 1460
攒了一身酷
攒了一身酷 2021-02-07 02:12

How can I change the style of a particular row based on a condition? I can use JSF EL in rich:column style class attribute, but I have to write for each column. I want to change

7条回答
  •  遥遥无期
    2021-02-07 02:53

    I do as you've already mentioned and put the style on the column.

    However you could always try wrapping all of your columns in a which is supposed to output a and place your conditional style on that.

    EDIT: (in response to comment): if the header facets in your columns are being broken then you can separate them into a column group as well. Should work - you may not even need the column group in the header??

    Eg.

    
      
        
          Header 1
          Header 1
        
      
      
        Data
        Data
      
    
    

提交回复
热议问题