ICEfaces
  1. ICEfaces
  2. ICE-7401

ace:DataTable row selection updates don't contain new selections

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta2
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      IF 2.1, Comp Suite
    • Assignee Priority:
      P1

      Description

      The row selection test of the comp suite is producing unexpected updates:

      http://localhost:8080/comp-suite/showcase.jsf?grp=aceMenu&exp=dataTableSelector

      When using the "ajax" selection option, the "status" panel group on the page is to be immediately updated with the details of the currently selected row objects. This doesn't happen, however refreshing the page renders the page as we would expect to have had following the updates.

      When using non-ajax selection, the no behaviour on selection is expected, and to compensate an update button is added to the page. This button has execute @all render @all set, and updates the contents of status as expected.

        Activity

        Hide
        Nils Lundquist added a comment -

        Using @all as the update parameter of the table "fixes" the issue, but only by causing an abnormally large update to the components in the form.

        ex.
        update="#

        {dataTableSelector.instantUpdate ? '@all' : 'none'}

        "

        This is promising to see, but highlights the oddity of the 'status' panelGroup update not working, consider it and the table are in the same naming container.

        Show
        Nils Lundquist added a comment - Using @all as the update parameter of the table "fixes" the issue, but only by causing an abnormally large update to the components in the form. ex. update="# {dataTableSelector.instantUpdate ? '@all' : 'none'} " This is promising to see, but highlights the oddity of the 'status' panelGroup update not working, consider it and the table are in the same naming container.
        Hide
        Deryk Sinotte added a comment -

        According to the class hierarchy of the datatable, it extends UIData which implements NamingContainer.

        Since a datatable is a naming container and the "status" panel is outside of the datatable, the find algorithm might not be able to located it just by using "status".  The full client id is "j_idt116:status". In other words, because status isn't in the table, we can't locate it simply by using "status" if I understand the heuristics of findComponent JavaDocs correctly.

        Show
        Deryk Sinotte added a comment - According to the class hierarchy of the datatable, it extends UIData which implements NamingContainer. Since a datatable is a naming container and the "status" panel is outside of the datatable, the find algorithm might not be able to located it just by using "status".  The full client id is "j_idt116:status". In other words, because status isn't in the table, we can't locate it simply by using "status" if I understand the heuristics of findComponent JavaDocs correctly.
        Hide
        Nils Lundquist added a comment -

        Interesting that this occurred now, but adding prependId="false" to the form, fixed the issue as expected.

        My guess is this is a result of the Id generation refactor that the table received in order to fix table nesting.

        Show
        Nils Lundquist added a comment - Interesting that this occurred now, but adding prependId="false" to the form, fixed the issue as expected. My guess is this is a result of the Id generation refactor that the table received in order to fix table nesting.
        Hide
        Nils Lundquist added a comment -

        Thanks Deryk

        Show
        Nils Lundquist added a comment - Thanks Deryk
        Hide
        Deryk Sinotte added a comment -

        I tried making this change to the example markup and it appears to behave correctly:

        Index: samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml
        ===================================================================
        — samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml (revision 29224)
        +++ samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml (revision )
        @@ -56,7 +56,7 @@
        </h:panelGrid>
        </h:form>

        • <h:form>
          + <h:form id="rowForm">
          <ace:dataTable id="carTableSingleRow"
          value="# {dataTableSort.carsData}

          "
          var="car"
          @@ -64,7 +64,7 @@
          stateMap="$

          {dataTableSelector.stateMap}"
          selectionMode="single"
          dblClickSelect="#{dataTableSelector.dblClick}"
          - update="#{dataTableSelector.instantUpdate ? 'status' : 'none'}"
          + update="#{dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}"
          rendered="#{dataTableSelector.selectionMode eq 'single'}">
          <ace:column>
          <f:facet name="header">
          @@ -123,7 +123,7 @@
          stateMap="#{dataTableSelector.stateMap}

          "
          selectionMode="multiple"
          dblClickSelect="#

          {dataTableSelector.dblClick}"
          - update="#{dataTableSelector.instantUpdate ? 'status' : 'none'}"
          + update="#{dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}"
          rendered="#{dataTableSelector.selectionMode eq 'multiple'}">
          <ace:column>
          <f:facet name="header">
          @@ -182,7 +182,7 @@
          cellSelection="#{dataTableSelector.singleCell}"
          selectionMode="singlecell"
          dblClickSelect="#{dataTableSelector.dblClick}

          "

        • update="# {dataTableSelector.instantUpdate ? 'status' : 'none'}

          "
          + update="#

          {dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}

          "
          rendered="#

          {dataTableSelector.selectionMode eq 'singlecell'}

          ">
          <ace:column>
          <f:facet name="header">
          @@ -241,7 +241,7 @@
          cellSelection="#

          {dataTableSelector.multiCell}

          "
          selectionMode="#

          {dataTableSelector.selectionMode}

          "
          dblClickSelect="#

          {dataTableSelector.dblClick}

          "

        • update="# {dataTableSelector.instantUpdate ? 'status' : 'none'}

          "
          + update="#

          {dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}

          "
          rendered="#

          {dataTableSelector.selectionMode eq 'multiplecell'}

          ">
          <ace:column>
          <f:facet name="header">

        Show
        Deryk Sinotte added a comment - I tried making this change to the example markup and it appears to behave correctly: Index: samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml =================================================================== — samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml (revision 29224) +++ samples/ace/comp-suite/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml (revision ) @@ -56,7 +56,7 @@ </h:panelGrid> </h:form> <h:form> + <h:form id="rowForm"> <ace:dataTable id="carTableSingleRow" value="# {dataTableSort.carsData} " var="car" @@ -64,7 +64,7 @@ stateMap="$ {dataTableSelector.stateMap}" selectionMode="single" dblClickSelect="#{dataTableSelector.dblClick}" - update="#{dataTableSelector.instantUpdate ? 'status' : 'none'}" + update="#{dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}" rendered="#{dataTableSelector.selectionMode eq 'single'}"> <ace:column> <f:facet name="header"> @@ -123,7 +123,7 @@ stateMap="#{dataTableSelector.stateMap} " selectionMode="multiple" dblClickSelect="# {dataTableSelector.dblClick}" - update="#{dataTableSelector.instantUpdate ? 'status' : 'none'}" + update="#{dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'}" rendered="#{dataTableSelector.selectionMode eq 'multiple'}"> <ace:column> <f:facet name="header"> @@ -182,7 +182,7 @@ cellSelection="#{dataTableSelector.singleCell}" selectionMode="singlecell" dblClickSelect="#{dataTableSelector.dblClick} " update="# {dataTableSelector.instantUpdate ? 'status' : 'none'} " + update="# {dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'} " rendered="# {dataTableSelector.selectionMode eq 'singlecell'} "> <ace:column> <f:facet name="header"> @@ -241,7 +241,7 @@ cellSelection="# {dataTableSelector.multiCell} " selectionMode="# {dataTableSelector.selectionMode} " dblClickSelect="# {dataTableSelector.dblClick} " update="# {dataTableSelector.instantUpdate ? 'status' : 'none'} " + update="# {dataTableSelector.instantUpdate ? ':rowForm:status' : 'none'} " rendered="# {dataTableSelector.selectionMode eq 'multiplecell'} "> <ace:column> <f:facet name="header">
        Hide
        Ken Fyten added a comment -

        We should avoid using prependId=false in the public sample apps. as most people will use the default (true), and using false can cause issues with portlets.

        Show
        Ken Fyten added a comment - We should avoid using prependId=false in the public sample apps. as most people will use the default (true), and using false can cause issues with portlets.
        Hide
        Nils Lundquist added a comment -

        Removed use of prependId="false"

        Show
        Nils Lundquist added a comment - Removed use of prependId="false"

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Nils Lundquist
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: