Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      217
    • Status Whiteboard:
      Hide

      cat2 renderkitdoc size_small importance_small

      Show
      cat2 renderkitdoc size_small importance_small

      Description

      Add a styleClass attribute to h:column and relegate the columnClasses attribute
      from h:dataTable to a purpose similar to what rowClasses does: cycle through
      each item in the list repeatedly (the use case being the ability to apply
      alternating styles, like differently-colored even and odd columns, without
      requiring knowledge of the number of columns).

      There should be nothing in the <h:dataTable> attribute list that is dependant
      upon the actual number of columns appearing inside of the table. All
      information related to specific columns should be associated with each column's
      corresponding <h:column> entity. Indeed, this is already the case with the sole
      exception of the columnClasses attribute.

      This is related to: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=426

        Issue Links

          Activity

          Hide
          Mark Struberg added a comment -

          hi!

          just like to push this up since I already came across this issue a few times.
          Today a colleague of mine had this again: he looked at <h:column> where he found the footerClass and headerClass attributes, but no styleClass for h:column. The columnClasses attribute in <h:dataTable> is not a full replacement since you cannot do data based css assignment.

          This is e.g needed if you have a accounting balance and a cash column with debit and credit values, and like to show all credits in green and debits in red.
          Of course you can do this with <span> but it is not really intuitive why there is no styleClass on the <td> at all.

          Show
          Mark Struberg added a comment - hi! just like to push this up since I already came across this issue a few times. Today a colleague of mine had this again: he looked at <h:column> where he found the footerClass and headerClass attributes, but no styleClass for h:column. The columnClasses attribute in <h:dataTable> is not a full replacement since you cannot do data based css assignment. This is e.g needed if you have a accounting balance and a cash column with debit and credit values, and like to show all credits in green and debits in red. Of course you can do this with <span> but it is not really intuitive why there is no styleClass on the <td> at all.
          Hide
          i_oss added a comment -

          +1 (also for Dan's style-attribute)

          Additionally i'd like to propose that we also add a possibility to add a styleClass/style per row, that can depend on the current var-value, instead of having to calculate the classes for all rows upfront. (There is also no way to add a style-attribute per row). Unfortunately rowClasses is already taken. While rowStyleClass would be perfect I think it is to close to rowClasses.
          so:

          <h:dataTable var="item" value="..." 
                  rowStyle="#{item.important ? 'font-weight: bold' : ''}"
                  rowStyleClass='trilternate#{component.rowIndex%3}'>
          

          Not so important: Introduce varstatus as for ui:repeat / c:forEach, even if you can calculate index/last/first/etc. from #

          {component}

          , I think most template authors will not know that + it gets ugly.

          Eventually!!! document, that 'global'-column-styling should be done with <f:facet name="colgroups">, if possible (less to render).

          Show
          i_oss added a comment - +1 (also for Dan's style-attribute) Additionally i'd like to propose that we also add a possibility to add a styleClass/style per row, that can depend on the current var-value, instead of having to calculate the classes for all rows upfront. (There is also no way to add a style-attribute per row). Unfortunately rowClasses is already taken. While rowStyleClass would be perfect I think it is to close to rowClasses. so: <h:dataTable var = "item" value= "..." rowStyle= "#{item.important ? 'font-weight: bold' : ''}" rowStyleClass='trilternate#{component.rowIndex%3}'> Not so important: Introduce varstatus as for ui:repeat / c:forEach, even if you can calculate index/last/first/etc. from # {component} , I think most template authors will not know that + it gets ugly. Eventually!!! document, that 'global'-column-styling should be done with <f:facet name="colgroups">, if possible (less to render).
          Hide
          codylerum added a comment -

          +1

          Defining classes one per column in order on the datatable via columnClasses is far to brittle. RichFaces has provided this for years in their rich:column via styleClass http://docs.jboss.org/richfaces/4.3.X/4.3.0.Final/vdldoc/

          Show
          codylerum added a comment - +1 Defining classes one per column in order on the datatable via columnClasses is far to brittle. RichFaces has provided this for years in their rich:column via styleClass http://docs.jboss.org/richfaces/4.3.X/4.3.0.Final/vdldoc/
          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
          Hide
          Manfred Riem added a comment -

          Setting priority to Major, because of higher vote count

          Show
          Manfred Riem added a comment - Setting priority to Major, because of higher vote count

            People

            • Assignee:
              Unassigned
              Reporter:
              dmlloyd
            • Votes:
              10 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: