ICEfaces
  1. ICEfaces
  2. ICE-11373

ace:dataTable column reordering ceases functioning after column sort

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-4.2.0.GA, EE-3.3.0.GA_P05
    • Fix Version/s: 4.3, EE-3.3.0.GA_P06
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ace dataTable reorder sort

      Description

      See attached test case. The column reordering works until you sort one of the headers and then the reordering is no longer available.

      Also, review the functionality of attributes for ace:dataTable:-
      reorderableColumns :- boolean when true enables the dragging and dropping of the columns
      columnOrdering:- required with reorderableColumns and is a list of Integers. Not sure why this is not within the component? Both are required for this functionality, but if there is no use-case for user interaction with this attribute in the component, then it should be within the component. As a minimum, it should be "@Required" if reoderableColumns attribute is true.

        Activity

        Judy Guglielmin created issue -
        Judy Guglielmin made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Judy Guglielmin made changes -
        Fix Version/s 4.3 [ 13096 ]
        Fix Version/s EE-3.3.0.GA_P07 [ 13118 ]
        Hide
        Judy Guglielmin added a comment -

        test case to deploy to tomcat

        Show
        Judy Guglielmin added a comment - test case to deploy to tomcat
        Judy Guglielmin made changes -
        Attachment SC14242.war [ 22652 ]
        Hide
        Judy Guglielmin added a comment -

        test case source

        Show
        Judy Guglielmin added a comment - test case source
        Judy Guglielmin made changes -
        Hide
        Arturo Zambrano added a comment -

        r52099, r52100: added dynamic javascript call to setup reorderable columns again on sort requests (4.0 trunk and 3.3 EE maintenance branch)

        Sort events trigger a dynamic update of the entire thead element, which causes the listeners associated with the reorderable columns functionality to be lost. So, as in other cases, a dynamic javascript call to re-apply these listeners is sent to the client on sort requests (if the table has this functionality enabled).

        Show
        Arturo Zambrano added a comment - r52099, r52100: added dynamic javascript call to setup reorderable columns again on sort requests (4.0 trunk and 3.3 EE maintenance branch) Sort events trigger a dynamic update of the entire thead element, which causes the listeners associated with the reorderable columns functionality to be lost. So, as in other cases, a dynamic javascript call to re-apply these listeners is sent to the client on sort requests (if the table has this functionality enabled).
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #52099 Tue Nov 21 15:17:34 MST 2017 art.zambrano ICE-11373 added dynamic javascript call to setup reorderable columns again on sort requests
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java
        Judy Guglielmin made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Arturo Zambrano added a comment -

        For the issue with the reset button. They would have to dynamically call the function to re-apply the reorderable columns behaviour in the client, from their own listener, since such request is not a sort request, which would trigger this dynamic javascript code to be sent to re-apply such behaviour.

        In order to do this, follow these two steps:

        1. import org.icefaces.util.JavaScriptRunner in the bean where the reset function is.

        2. Add the following code at the end of the reset listener:

        For ICEfaces 4:

        JavaScriptRunner.runScript(context, "(function(){var table = ice.ace.instance('" + tableClientId + "');if(table) {table.setupResizableColumns(); table.setupReorderableColumns();}})();");
        

        For ICEfaces 3:

        JavaScriptRunner.runScript(context, "(function(){var table = window." + tableWidgetVar + ";if(table) {table.setupResizableColumns(); table.setupReorderableColumns();}})();");
        

        Simply replace 'tableClientId' or 'tableWidgetVar' as appropriate.

        Note that I couldn't actually reproduce the issue on the test case I was given, since the reset button (link, actually) didn't seem to work. It didn't reset the order.

        Show
        Arturo Zambrano added a comment - For the issue with the reset button. They would have to dynamically call the function to re-apply the reorderable columns behaviour in the client, from their own listener, since such request is not a sort request, which would trigger this dynamic javascript code to be sent to re-apply such behaviour. In order to do this, follow these two steps: 1. import org.icefaces.util.JavaScriptRunner in the bean where the reset function is. 2. Add the following code at the end of the reset listener: For ICEfaces 4: JavaScriptRunner.runScript(context, "(function(){ var table = ice.ace.instance('" + tableClientId + "'); if (table) {table.setupResizableColumns(); table.setupReorderableColumns();}})();" ); For ICEfaces 3: JavaScriptRunner.runScript(context, "(function(){ var table = window." + tableWidgetVar + "; if (table) {table.setupResizableColumns(); table.setupReorderableColumns();}})();" ); Simply replace 'tableClientId' or 'tableWidgetVar' as appropriate. Note that I couldn't actually reproduce the issue on the test case I was given, since the reset button (link, actually) didn't seem to work. It didn't reset the order.
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P06 [ 13114 ]
        Fix Version/s EE-3.3.0.GA_P07 [ 13118 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: