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

        Hide
        Judy Guglielmin added a comment -

        test case to deploy to tomcat

        Show
        Judy Guglielmin added a comment - test case to deploy to tomcat
        Hide
        Judy Guglielmin added a comment -

        test case source

        Show
        Judy Guglielmin added a comment - test case source
        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).
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: