ICEfaces
  1. ICEfaces
  2. ICE-7292

dynamic ace:datatable columns missing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tomcat 7.0.12

      Description

      In the Williams application, there is a component at the top affecting the state of the ace:datatable:

      <f:ajax render="@form :WgpMainMessageNotificationBarStatus" execute="@this"
      listener="#{confirmationPdaBean.confirmingLevelChange}">
      <h:selectOneMenu id="confirmingLevelFilter" label="Confirming Level" rendered="#{!confirmationPdaBean.downloadPages}"
      value="#{confirmationPdaBean.confirmingLevelFilterObject}" required="true"
      onchange="showProcessingMessage('Processing Filter Change')">
      <f:selectItem itemValue="#{null}" itemLabel="NONE SELECTED"
      noSelectionOption="true" />
      <f:selectItems value="#{confirmationPdaBean.confirmingLevelItems}" />
      </h:selectOneMenu>
      </f:ajax>

      The listener is changing the value of the ace:dataTable to a datatable with more columns. When the update is applied, only the previous number of columns are displayed and the final column spans the width of the other headers (see attached screenshot).

      The empty space in the datatable should be populated with content.

        Activity

        Hide
        Nils Lundquist added a comment -

        How are these columns being made dynamic? Just being toggled on by the application at that point using the rendered attribute?

        We are currently experiencing some odd behavior elsewhere regarding the state of Column rendered.

        Show
        Nils Lundquist added a comment - How are these columns being made dynamic? Just being toggled on by the application at that point using the rendered attribute? We are currently experiencing some odd behavior elsewhere regarding the state of Column rendered.
        Hide
        Brad Kroeger added a comment -

        Using the h:selectOneMenu they are swapping out datatable markup, not toggling the rendered attribute. They have a facelet that populates the datatable content:

        Template:
        <ace:dataTable id="listDataTable"
        value="#

        {backingBean.rows}

        "
        var="row"
        rows="#

        {backingBean.displayedRows}

        "
        widgetVar="dataTableWidget_#

        {backingBean.tabIndex}

        "
        paginator="#

        {printPreviewBackingBean.printPreview ?'false' : backingBean.paging}

        "
        paginatorTemplate="

        {CurrentPageReport}

        {FirstPageLink}

        {PreviousPageLink}

        {PageLinks}

        {NextPageLink}

        {LastPageLink}

        {RowsPerPageDropdown}

        "
        rowsPerPageTemplate="#

        {backingBean.rowsPerPageTemplate}

        "
        selectionMode="#

        {selectionMode==null? 'single': selectionMode}

        "
        stateMap="#

        {backingBean.stateMap}

        "
        first="#

        {backingBean.table1First}

        "
        style="width:98%; margin-left: 1px;">

        <ui:insert name="dataTbl" />

        </ace:dataTable>

        Template Client:

        <ui:define name="dataTbl">
        <ui:include src="#

        {confirmationPdaBean.confirmingLevelFacelet}

        " />
        </ui:define>

        Example facelet:

        <ace:columnGroup type="header">

        <ace:row>
        <ace:column colspan="5" headerText="PDA Information" rendered="#

        {confirmationPdaBean.hasNonLDCPdaData }

        " />
        <ace:column headerText="" rendered="#

        {confirmationPdaBean.hasLDCPdaData}"/>
        <ace:column colspan="4"
        headerText="Contract Confirmation Information" />
        <ace:column colspan="#{confirmationPdaBean.quantitiesColumnSpan}"
        headerText="Quantities for Selected Cycle" />
        <ace:column colspan="2" headerText="Last Confirmed at This Level" />
        </ace:row>
        <ace:row>
        <ui:include src="confirmation_pda_non_ldc_header.xhtml"></ui:include>
        <ace:column headerText="" rendered="#{confirmationPdaBean.hasLDCPdaData}

        "/>
        <ace:column headerText="K Flo" sortBy="flowDirectionString" />
        <ui:include src="confirmation_pda_contract_info_header.xhtml"></ui:include>
        <ui:include src="#

        {confirmationPdaBean.quantitiesHeaderFacelet}

        "></ui:include>
        <ui:include src="confirmation_pda_confirmed_header.xhtml"></ui:include>
        </ace:row>
        </ace:columnGroup>
        <ui:include src="confirmation_pda_non_ldc_data.xhtml"></ui:include>
        <ace:column rendered="#

        {confirmationPdaBean.hasLDCPdaData and row.hasPdaData}

        "><ace:expansionToggler /></ace:column>
        <ace:column rendered="#

        {confirmationPdaBean.hasLDCPdaData and !row.hasPdaData}

        "></ace:column>
        <ace:column>
        <h:outputText value="#

        {row.flowDirectionString}

        " />
        <wgp:rowLevelMessage row="#

        {row}

        " backingBean="#

        {confirmationPdaBean}

        " />
        </ace:column>
        <ui:include src="confirmation_pda_contract_info_column.xhtml"></ui:include>
        <ui:include src="#

        {confirmationPdaBean.quantitiesColumnFacelet}

        "></ui:include>
        <ui:include src="confirmation_pda_confirmed_column.xhtml"></ui:include>
        <ui:include src="confirmation_pda_datatable_row_expansion.xhtml"></ui:include>

        Show
        Brad Kroeger added a comment - Using the h:selectOneMenu they are swapping out datatable markup, not toggling the rendered attribute. They have a facelet that populates the datatable content: Template: <ace:dataTable id="listDataTable" value="# {backingBean.rows} " var="row" rows="# {backingBean.displayedRows} " widgetVar="dataTableWidget_# {backingBean.tabIndex} " paginator="# {printPreviewBackingBean.printPreview ?'false' : backingBean.paging} " paginatorTemplate=" {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} " rowsPerPageTemplate="# {backingBean.rowsPerPageTemplate} " selectionMode="# {selectionMode==null? 'single': selectionMode} " stateMap="# {backingBean.stateMap} " first="# {backingBean.table1First} " style="width:98%; margin-left: 1px;"> <ui:insert name="dataTbl" /> </ace:dataTable> Template Client: <ui:define name="dataTbl"> <ui:include src="# {confirmationPdaBean.confirmingLevelFacelet} " /> </ui:define> Example facelet: <ace:columnGroup type="header"> <ace:row> <ace:column colspan="5" headerText="PDA Information" rendered="# {confirmationPdaBean.hasNonLDCPdaData } " /> <ace:column headerText="" rendered="# {confirmationPdaBean.hasLDCPdaData}"/> <ace:column colspan="4" headerText="Contract Confirmation Information" /> <ace:column colspan="#{confirmationPdaBean.quantitiesColumnSpan}" headerText="Quantities for Selected Cycle" /> <ace:column colspan="2" headerText="Last Confirmed at This Level" /> </ace:row> <ace:row> <ui:include src="confirmation_pda_non_ldc_header.xhtml"></ui:include> <ace:column headerText="" rendered="#{confirmationPdaBean.hasLDCPdaData} "/> <ace:column headerText="K Flo" sortBy="flowDirectionString" /> <ui:include src="confirmation_pda_contract_info_header.xhtml"></ui:include> <ui:include src="# {confirmationPdaBean.quantitiesHeaderFacelet} "></ui:include> <ui:include src="confirmation_pda_confirmed_header.xhtml"></ui:include> </ace:row> </ace:columnGroup> <ui:include src="confirmation_pda_non_ldc_data.xhtml"></ui:include> <ace:column rendered="# {confirmationPdaBean.hasLDCPdaData and row.hasPdaData} "><ace:expansionToggler /></ace:column> <ace:column rendered="# {confirmationPdaBean.hasLDCPdaData and !row.hasPdaData} "></ace:column> <ace:column> <h:outputText value="# {row.flowDirectionString} " /> <wgp:rowLevelMessage row="# {row} " backingBean="# {confirmationPdaBean} " /> </ace:column> <ui:include src="confirmation_pda_contract_info_column.xhtml"></ui:include> <ui:include src="# {confirmationPdaBean.quantitiesColumnFacelet} "></ui:include> <ui:include src="confirmation_pda_confirmed_column.xhtml"></ui:include> <ui:include src="confirmation_pda_datatable_row_expansion.xhtml"></ui:include>
        Hide
        Nils Lundquist added a comment -

        This behaviour can be explained by mechanisms regarding the column reordering feature. It tries to keep an ordering based on the order of the columns in the facelet source. By dynamically swapping this, the components internal list of columns and their ordering is invalidated.

        I'll look into adjusting this behaviour to be more lazy towards the column list, and begin ordering the columns by hash code rather than child index.

        Show
        Nils Lundquist added a comment - This behaviour can be explained by mechanisms regarding the column reordering feature. It tries to keep an ordering based on the order of the columns in the facelet source. By dynamically swapping this, the components internal list of columns and their ordering is invalidated. I'll look into adjusting this behaviour to be more lazy towards the column list, and begin ordering the columns by hash code rather than child index.
        Hide
        Brad Kroeger added a comment -

        At this point they should be using Mojarra JSF 2.1.3

        Show
        Brad Kroeger added a comment - At this point they should be using Mojarra JSF 2.1.3
        Hide
        Nils Lundquist added a comment -

        Resolved by removing caching of the result of getColumns().

        Column components are now also recursively searched for within the children of the DataTable.

        Show
        Nils Lundquist added a comment - Resolved by removing caching of the result of getColumns(). Column components are now also recursively searched for within the children of the DataTable.

          People

          • Assignee:
            Unassigned
            Reporter:
            Brad Kroeger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: