ICEfaces
  1. ICEfaces
  2. ICE-11374

ace:dataTable, preserve column pinning order after reloading the page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2
    • Fix Version/s: 4.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Any

      Description

      There exists already some code that aims at preserving the current pinning state of the columns in a table. However, it doesn't seem to be working, since the pinning state of all columns is reset when reloading the page, even if the 'pinningOrder' attributes of the ace:column components are associated to a session-scoped bean. This JIRA is to fix this functionality.

        Issue Links

          Activity

          Hide
          Arturo Zambrano added a comment - - edited

          r52109: fixed JSON parsing issue that was preventing the columns to be pinned again when reloading the page and in other cases as well

          Notes:
          This is what is meant when talking about preserving the column pinning order after reloading the page: if the columns of a table have a value in their 'pinningOrder' property on the server side, these columns should be pinned in such order when first loading the page or when reloading the page. The pinning order is preserved only if the app developer added some code for this purpose. The pinning order doesn't have to preserve the pinning order across reloads, just as selected rows in a table become unselected after reloading the page, unless there's a row state map object with a window or session scope.

          When testing this feature, a simple session-scoped bean was created to store the 'pinningOrder' values of some columns in the columnPinning.jsf test page. The bean looks like the following code:

          package org.icefaces.datatable;
          
          import javax.faces.bean.ManagedBean;
          import javax.faces.bean.SessionScoped;
          
          @ManagedBean
          @SessionScoped
          public class OrderBean implements java.io.Serializable {
          
          	private static final long serialVersionUID = 1L;
          
          	private Integer po1;
          	public Integer getPo1() { return po1; }
          	public void setPo1(Integer po1) { this.po1 = po1; }
          
          	private Integer po2;
          	public Integer getPo2() { return po2; }
          	public void setPo2(Integer po2) { this.po2 = po2; }
          
          	private Integer po3;
          	public Integer getPo3() { return po3; }
          	public void setPo3(Integer po3) { this.po3 = po3; }
          }
          

          It was also necessary to add <ace:ajax event="pin" /> to the <ace:datatable> component in order to communicate to the server the pinned state of the client.

          Show
          Arturo Zambrano added a comment - - edited r52109: fixed JSON parsing issue that was preventing the columns to be pinned again when reloading the page and in other cases as well Notes: This is what is meant when talking about preserving the column pinning order after reloading the page: if the columns of a table have a value in their 'pinningOrder' property on the server side, these columns should be pinned in such order when first loading the page or when reloading the page. The pinning order is preserved only if the app developer added some code for this purpose. The pinning order doesn't have to preserve the pinning order across reloads, just as selected rows in a table become unselected after reloading the page, unless there's a row state map object with a window or session scope. When testing this feature, a simple session-scoped bean was created to store the 'pinningOrder' values of some columns in the columnPinning.jsf test page. The bean looks like the following code: package org.icefaces.datatable; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean @SessionScoped public class OrderBean implements java.io.Serializable { private static final long serialVersionUID = 1L; private Integer po1; public Integer getPo1() { return po1; } public void setPo1( Integer po1) { this .po1 = po1; } private Integer po2; public Integer getPo2() { return po2; } public void setPo2( Integer po2) { this .po2 = po2; } private Integer po3; public Integer getPo3() { return po3; } public void setPo3( Integer po3) { this .po3 = po3; } } It was also necessary to add <ace:ajax event="pin" /> to the <ace:datatable> component in order to communicate to the server the pinned state of the client.
          Hide
          Arturo Zambrano added a comment -

          r52118: added example for saving column pinning state in the server

          Show
          Arturo Zambrano added a comment - r52118: added example for saving column pinning state in the server
          Hide
          Arturo Zambrano added a comment -

          r52451: added ajax event for the unpin event as well, for state-saving purposes

          Show
          Arturo Zambrano added a comment - r52451: added ajax event for the unpin event as well, for state-saving purposes

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Arturo Zambrano
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: