1 Reply Latest reply on Sep 2, 2009 5:17 PM by Jean Luc

    Optimizing expression calculation for tables?

    Jean Luc Apprentice

      Hello,


      I'm looking for solutions for the following performance problem. A large table needs to have conditional styling on its rows, based on each particular row's data. To be precise, the entire row is highlighted in a particular colour (like green, yellow, red - in reality colours are not that wild :-).
      The straight-forward JSF approach is to have <rich:column styleClass="#{some EL expression here}">. While it works, it is evaluated for each column, although only once per row is enough. There is no <rich:row> tag under <rich:dataTable>.


      I haven't found a way with JSF/EL to set a variable outside the list of columns and just reference there from each column, something like <rich:column styleClass="#{rowStyle}">.


      Now, with Seam I'm thinking to define a factory method in the associated action bean of the view. The thing I'm not sure about is the scope of this method as it would need to last as long as the rendering of a row in the table. EVENT is too coarse, METHOD doesn't appear to do what I need either.


      Any ideas are appreciated. Again, to state it more abstractly, I'm looking for a way to evaluate then cache an EL expression once per row, during the rendering of a rich dataTable.


      Thank you.