ICEfaces
  1. ICEfaces
  2. ICE-8639

ace:dataTable - Add capability to freeze a column and allow the rest of the contents to scroll horizontally

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, EE-3.0.0.GA_P01
    • Fix Version/s: EE-3.2.0.BETA, EE-3.2.0.GA, 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All

      Description


      Feature Request: Add the ability to freeze or lock a column in place and allow the rest of the columns to scroll horizontally. For example the left most column would be locked in place and the rest of the columns could be scrolled while the left column remained in place.

        Issue Links

          Activity

          Migration created issue -
          Hide
          Nils Lundquist added a comment - - edited

          Well to start off this mode won't be interoperable with multi row headers or the static-header scrollable mode.

          Show
          Nils Lundquist added a comment - - edited Well to start off this mode won't be interoperable with multi row headers or the static-header scrollable mode.
          Hide
          Ken Fyten added a comment - - edited

          Yes it will.
          (Restricted to icesoft-internal-developers group)

          Show
          Ken Fyten added a comment - - edited Yes it will. (Restricted to icesoft-internal-developers group)
          Hide
          Nils Lundquist added a comment - - edited

          As per discussiona with Ken, static header- and multirow (in particular) support will becoming in future revisions.
          (Restricted to icesoft-internal-developers group)

          Show
          Nils Lundquist added a comment - - edited As per discussiona with Ken, static header- and multirow (in particular) support will becoming in future revisions. (Restricted to icesoft-internal-developers group)
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32283 Wed Nov 21 14:09:42 MST 2012 nils.lundquist ICE-8639 - ace:dataTable column pinning beta version
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableDecoder.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/json/JSONObject.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableConstants.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableHeadRenderer.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/column/ColumnMeta.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.css
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableMeta.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderingContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32285 Wed Nov 21 16:30:37 MST 2012 nils.lundquist ICE-8639 - ace:dataTable column pinning beta showcase example
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/resources/org/icefaces/samples/showcase/view/resources/messages.properties
          Commit graph ADD /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dataTable/dataTablePinning.xhtml
          Commit graph ADD /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTablePinning.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTableBean.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32311 Thu Nov 22 14:24:22 MST 2012 nils.lundquist ICE-8639 - ace:dataTable column pinning client behaviours, unpinning
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableDecoder.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableHeadRenderer.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/column/ColumnMeta.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.css
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableMeta.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dataTable/dataTablePinning.xhtml
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTablePinning.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32339 Fri Nov 23 14:42:00 MST 2012 nils.lundquist ICE-8639 - ace:dataTable column pinning improved IE7 behaviour
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32519 Thu Nov 29 13:38:19 MST 2012 nils.lundquist ICE-8639 - column pinning IE7 compatibility.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.css
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableMeta.java
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
          Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dataTable/dataTablePinning.xhtml
          Migration made changes -
          Field Original Value New Value
          Reporter Migration [ remote ] Arran Mccullough [ arran.mccullough ]
          Migration made changes -
          Fix Version/s 3.3 [ 10370 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #32598 Mon Dec 03 17:17:29 MST 2012 nils.lundquist ICE-8639 - column pinning bugfixes and improvements
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
          Hide
          Ken Fyten added a comment -

          Nils Lundquist commented on ICE-8639:
          -------------------------------------

          Revision #32283
          Committed by nils.lundquist
          Nov. 21st
          ICE-8639 - ace:dataTable column pinning beta version

          Show
          Ken Fyten added a comment - Nils Lundquist commented on ICE-8639 : ------------------------------------- Revision #32283 Committed by nils.lundquist Nov. 21st ICE-8639 - ace:dataTable column pinning beta version
          Ken Fyten made changes -
          Fix Version/s EE-3.2.0.GA [ 10332 ]
          Ken Fyten made changes -
          Assignee Nils Lundquist [ nils.lundquist ]
          Hide
          Nils Lundquist added a comment -

          Initial revision of feature complete pending client feedback. A new JIRA has been opened for known border-driven misalignments.

          Show
          Nils Lundquist added a comment - Initial revision of feature complete pending client feedback. A new JIRA has been opened for known border-driven misalignments.
          Nils Lundquist made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s EE-3.2.0.BETA [ 10573 ]
          Hide
          Russell Lewandowski added a comment -

          SVN 32311, ICE-8639 made a change to the compare that accidentally compared the itemVal to the filterEvent and not the filterVal. Small typo. Attached is the correct code to make this functionality work again. Functionality works in ICEfaces 3.2, only effects 3.3.SNAPSHOT.

          org.icefaces.ace.component.datatable.DataTableHeadRenderer.java
              private static void encodeFilter(FacesContext context, DataTableRenderingContext tableContext, Column column) throws IOException {
                  Map<String,String> params = context.getExternalContext().getRequestParameterMap();
                  ResponseWriter writer = context.getResponseWriter();
                  DataTable table = tableContext.getTable();
          
                  String widgetVar = CoreRenderer.resolveWidgetVar(table);
                  String filterId = column.getClientId(context) + "_filter";
                  String filterFunction = widgetVar + ".filter(event)";
                  String filterStyleClass = column.getFilterStyleClass();
                  String filterEvent = table.getFilterEvent();
                  filterStyleClass = filterStyleClass == null
                          ? DataTableConstants.COLUMN_FILTER_CLASS
                          : DataTableConstants.COLUMN_FILTER_CLASS + " " + filterStyleClass;
          
                  if (column.getValueExpression("filterOptions") == null) {
                      String filterValue = column.getFilterValue() != null ? column.getFilterValue() : "";
          
                      writer.startElement(HTML.INPUT_ELEM, null);
                      writer.writeAttribute(HTML.ID_ATTR, filterId, null);
                      writer.writeAttribute(HTML.NAME_ATTR, filterId, null);
                      writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null);
                      writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null);
                      writer.writeAttribute("size", "1", null); // Webkit requires none zero/null size value to use CSS width correctly.
                      writer.writeAttribute("value", filterValue , null);
          
                      if (filterEvent.equals("keyup") || filterEvent.equals("blur"))
                          writer.writeAttribute("on"+filterEvent, filterFunction , null);
          
                      if (column.getFilterStyle() != null)
                          writer.writeAttribute(HTML.STYLE_ELEM, column.getFilterStyle(), null);
          
                      writer.endElement(HTML.INPUT_ELEM);
                  }
                  else {
                      writer.startElement("select", null);
                      writer.writeAttribute(HTML.ID_ATTR, filterId, null);
                      writer.writeAttribute(HTML.NAME_ATTR, filterId, null);
                      writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null);
                      writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null);
                      writer.writeAttribute("onchange", filterFunction, null);
          
                      SelectItem[] itemsArray = (SelectItem[]) getFilterOptions(column);
                      Object filterVal = column.getFilterValue();
          
                      for (SelectItem item : itemsArray) {
                          writer.startElement("option", null);
                          writer.writeAttribute("value", item.getValue(), null);
          
                          Object itemVal = item.getValue();
          
                          if ((filterVal == null && itemVal == null) || itemVal.toString().equals(filterVal)) {  // filterVal was filterEvent
                              writer.writeAttribute("selected", "true", null);
                          }
          
                          writer.write(item.getLabel());
                          writer.endElement("option");
                      }
          
                      writer.endElement("select");
                  }
          
              }
          
          Show
          Russell Lewandowski added a comment - SVN 32311, ICE-8639 made a change to the compare that accidentally compared the itemVal to the filterEvent and not the filterVal. Small typo. Attached is the correct code to make this functionality work again. Functionality works in ICEfaces 3.2, only effects 3.3.SNAPSHOT. org.icefaces.ace.component.datatable.DataTableHeadRenderer.java private static void encodeFilter(FacesContext context, DataTableRenderingContext tableContext, Column column) throws IOException { Map< String , String > params = context.getExternalContext().getRequestParameterMap(); ResponseWriter writer = context.getResponseWriter(); DataTable table = tableContext.getTable(); String widgetVar = CoreRenderer.resolveWidgetVar(table); String filterId = column.getClientId(context) + "_filter" ; String filterFunction = widgetVar + ".filter(event)" ; String filterStyleClass = column.getFilterStyleClass(); String filterEvent = table.getFilterEvent(); filterStyleClass = filterStyleClass == null ? DataTableConstants.COLUMN_FILTER_CLASS : DataTableConstants.COLUMN_FILTER_CLASS + " " + filterStyleClass; if (column.getValueExpression( "filterOptions" ) == null ) { String filterValue = column.getFilterValue() != null ? column.getFilterValue() : ""; writer.startElement(HTML.INPUT_ELEM, null ); writer.writeAttribute(HTML.ID_ATTR, filterId, null ); writer.writeAttribute(HTML.NAME_ATTR, filterId, null ); writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null ); writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null ); writer.writeAttribute( "size" , "1" , null ); // Webkit requires none zero/ null size value to use CSS width correctly. writer.writeAttribute( "value" , filterValue , null ); if (filterEvent.equals( "keyup" ) || filterEvent.equals( "blur" )) writer.writeAttribute( "on" +filterEvent, filterFunction , null ); if (column.getFilterStyle() != null ) writer.writeAttribute(HTML.STYLE_ELEM, column.getFilterStyle(), null ); writer.endElement(HTML.INPUT_ELEM); } else { writer.startElement( "select" , null ); writer.writeAttribute(HTML.ID_ATTR, filterId, null ); writer.writeAttribute(HTML.NAME_ATTR, filterId, null ); writer.writeAttribute(HTML.TABINDEX_ATTR, tableContext.getTabIndex(), null ); writer.writeAttribute(HTML.CLASS_ATTR, filterStyleClass, null ); writer.writeAttribute( "onchange" , filterFunction, null ); SelectItem[] itemsArray = (SelectItem[]) getFilterOptions(column); Object filterVal = column.getFilterValue(); for (SelectItem item : itemsArray) { writer.startElement( "option" , null ); writer.writeAttribute( "value" , item.getValue(), null ); Object itemVal = item.getValue(); if ((filterVal == null && itemVal == null ) || itemVal.toString().equals(filterVal)) { // filterVal was filterEvent writer.writeAttribute( "selected" , " true " , null ); } writer.write(item.getLabel()); writer.endElement( "option" ); } writer.endElement( "select" ); } }
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #33141 Mon Jan 21 09:57:14 MST 2013 nils.lundquist ICE-8639 - ace:dataTable fixed drop down filtering selected state.
          Files Changed
          Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableHeadRenderer.java
          Hide
          Nils Lundquist added a comment -

          Thanks for catching this, there must be a hole in our tests for this to have slipped through.

          Show
          Nils Lundquist added a comment - Thanks for catching this, there must be a hole in our tests for this to have slipped through.
          Ken Fyten made changes -
          Link This issue blocks ICE-9128 [ ICE-9128 ]
          Ken Fyten made changes -
          Link This issue is duplicated by ICE-8487 [ ICE-8487 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: