Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1.3
    • Fix Version/s: 1.1.7
    • Component/s: Extended Datatable
    • Labels:
      None
    • Environment:
      Microsoft Windows XP Professional Version 2002 Service Pack 2, Microsoft Internet Explorer Version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519, IBM Rational Software Development Platform Version: 6.0.1 Build id: 20050725_1800, WebSphere Application Server v6.0

      Description

      I am using <t:dataTable> and I am using the attribute columnClasses. According to (http://myfaces.apache.org/tomahawk/tlddoc/t/dataTable.html) columnClasses - A comma separated list of CSS class names to apply to td elements in each column.

      But this does not happen, when I define the columnClasses styles to be applied in each column only the very first class is rendered for all columns.

      This is how I did it:
      <t:dataTable id="myDetailDataTable" var="row" value="#

      {myDetailList.rows}

      " cellspacing="0" columnClasses="columnClassLock,columnClassUnlock" headerClass="headerClassTopLock" rowClasses="rowOdd,rowEven" styleClass="dataTable">
      <t:columns value="#

      {myDetailList.columns}

      " var="currentColumn">
      <f:facet name="header">
      <h:outputText value="#

      {currentColumn.name}

      "/>
      </f:facet>
      <h:outputText value="#

      {myDetailList.columnValue[currentColumn.name]} " style="#{myDetailList.columnValue[currentColumn.label]}" rendered="#{not myDetailList.columnValue[currentColumn.render]}" escape="false"/>
      <h:inputText value="#{myDetailList.columnValue[currentColumn.name]}

      " style="#

      {myDetailList.columnValue[currentColumn.label]}

      " rendered="#

      {myDetailList.columnValue [currentColumn.render]}

      " size="6" maxlength="15">
      <f:converter converterId="javax.faces.BigDecimal"/>
      </h:inputText>
      </t:columns>
      </t:dataTable>

        Activity

        lea vogt created issue -
        David Brainard made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        David Brainard added a comment -

        Hi lea,

        I have fixed the bug. there was a problem in the columnStyleIndex generation. i.e

        -In encodeColumnChild() method of the HtmlTableRenderer if the child is a UIColumns then the columnStyleIndex remains the same for all the child components.

        renderColumnBody(facesContext, writer, uiData, component,
        styles, columnStyleIndex );
        to avoid this i have added counter 'k' to the columnStyleIndex

        • To manage when both UIColumns and UICoulmn are added to the datatable, the encodeInnerHtml() method in the HtmlTableRendererBase class need to be changed as follows:
          nc * uiData.getChildCount() + j + childCount-columnsCount

        I am attaching both the classes(HtmlTableRenderer and HtmlTableRendererBase ) for both 1.1.6 release and the latest snapshot 1.1.7.

        I AM NEW TO THIS SO CAN ANYONE PLS VALIDATE THIS FIX AND CREATE A PATCH(DIFF) FOR THIS BUG .

        Show
        David Brainard added a comment - Hi lea, I have fixed the bug. there was a problem in the columnStyleIndex generation. i.e -In encodeColumnChild() method of the HtmlTableRenderer if the child is a UIColumns then the columnStyleIndex remains the same for all the child components. renderColumnBody(facesContext, writer, uiData, component, styles, columnStyleIndex ); to avoid this i have added counter 'k' to the columnStyleIndex To manage when both UIColumns and UICoulmn are added to the datatable, the encodeInnerHtml() method in the HtmlTableRendererBase class need to be changed as follows: nc * uiData.getChildCount() + j + childCount-columnsCount I am attaching both the classes(HtmlTableRenderer and HtmlTableRendererBase ) for both 1.1.6 release and the latest snapshot 1.1.7. I AM NEW TO THIS SO CAN ANYONE PLS VALIDATE THIS FIX AND CREATE A PATCH(DIFF) FOR THIS BUG .
        Hide
        David Brainard added a comment -

        zip containing the 1.1.7 renderers

        Show
        David Brainard added a comment - zip containing the 1.1.7 renderers
        David Brainard made changes -
        Attachment 1.1.7 nightly snapshot.zip [ 12367721 ]
        David Brainard made changes -
        Attachment 1.1.6.zip [ 12367722 ]
        Hide
        Mike Kienenberger added a comment -

        David,

        Thanks for taking a look at this issue.

        You can find instructions on creating a patch here:

        http://wiki.apache.org/myfaces/Contributing_Patches

        Show
        Mike Kienenberger added a comment - David, Thanks for taking a look at this issue. You can find instructions on creating a patch here: http://wiki.apache.org/myfaces/Contributing_Patches
        David Brainard made changes -
        Attachment 1.1.6.zip [ 12367722 ]
        David Brainard made changes -
        Attachment 1.1.7 nightly snapshot.zip [ 12367721 ]
        David Brainard made changes -
        Attachment HtmlTableRenderer.patch [ 12368408 ]
        Hide
        David Brainard added a comment -

        Patch added.

        Additional method getColumnStyleIndex() has been added to the HtmlTableRenderer class. This method calculates the correct columnStyleIndex taking the dynamic columns of UIColumns into consideration since uiData.getChildren() doesnt take the dynamic columns into consideration..

        -David Brainard

        Show
        David Brainard added a comment - Patch added. Additional method getColumnStyleIndex() has been added to the HtmlTableRenderer class. This method calculates the correct columnStyleIndex taking the dynamic columns of UIColumns into consideration since uiData.getChildren() doesnt take the dynamic columns into consideration.. -David Brainard
        David Brainard made changes -
        Attachment HtmlTableRenderer.patch [ 12368408 ]
        David Brainard made changes -
        Attachment HtmlTableRenderer.patch [ 12368410 ]
        Hide
        Leonardo Uribe added a comment -

        I have checked the issue in deep and it is right

        UIColumns should not count as one, instead it should count as many columns it represents, so the result is if you have this definition:

        .column1

        { background:yellow; }

        .column2

        { background:blue; }

        .column3

        { background:red; }

        <t:dataTable columnClasses="column1,column2,column3"

        and you have a table with tree normal UIColumn and one UIColumns that represent tree, you should see:

        yellow, blue, red, yellow, blue, red

        instead

        yellow, blue red, yellow, yellow, yellow

        fixed at revision 667697

        Show
        Leonardo Uribe added a comment - I have checked the issue in deep and it is right UIColumns should not count as one, instead it should count as many columns it represents, so the result is if you have this definition: .column1 { background:yellow; } .column2 { background:blue; } .column3 { background:red; } <t:dataTable columnClasses="column1,column2,column3" and you have a table with tree normal UIColumn and one UIColumns that represent tree, you should see: yellow, blue, red, yellow, blue, red instead yellow, blue red, yellow, yellow, yellow fixed at revision 667697
        Leonardo Uribe made changes -
        Resolution Fixed [ 1 ]
        Status Patch Available [ 10002 ] Closed [ 6 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Fix Version/s 1.1.7 [ 12313398 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            lea vogt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development