ICEfaces
  1. ICEfaces
  2. ICE-9411

Refactor ace:dataTable cell selection to use RowState

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      *
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial

      Description

      As a result of changes to cell selection undertaken as part of ICE-9384 an opportunity has presented itself to unify the selection APIs.

        Activity

        Nils Lundquist created issue -
        Nils Lundquist made changes -
        Field Original Value New Value
        Assignee Nils Lundquist [ nils.lundquist ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36622 Wed Jul 10 12:56:07 MDT 2013 nils.lundquist ICE-9411 / ICE-9384 - Simplified API for cell selection and unified with other row/cell features in RowState. Reworked selection and expansion so state changes take place in updateModel. Simplified and renamed showcase selection example.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTable.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/PageState.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableDecoder.java
        Commit graph ADD /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/SelectionDeltaState.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/resources/org/icefaces/samples/showcase/view/resources/messages.properties
        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/model/table/RowState.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderingContext.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/SortState.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTableSelector.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/FilterState.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/expansiontoggler/ExpansionToggler.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/model/table/RowStateMap.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/expansiontoggler/ExpansionTogglerMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTableBean.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableRowRenderer.java
        Hide
        Nils Lundquist added a comment -

        Removed the following public cell selection methods from DataTable.java:
        removeSelectedCell(String);
        removeSelectedCells(String);
        addSelectedCell(String);
        addSelectedCells(String);
        getSelectedCells();
        clearCellSelection();

        In the previous implementation of cell selection, cells were passed to application bean logic as CellSelections objects. These objects contained a reference to the row object as well as 'extracted' field names from the value expression (selectBy) required on any column in a table using cell selection.

        This implementation was not very robust since the parsing of column value expressions for row object field names is misguided; a column value expression may access values that are not row object fields or have a complex relationship to the row object that cannot be parsed. It also precludes the selection of cells where there is no value expression. In these cases the information provided by the CellSelections object would be useless.

        This parsing of field names was desired so we could supply column values to the app dev seamlessly. This now appears misguided and unnecessary. It's easy enough for the app dev to know when writing selections processing, given a Column component and row model object, if the children of that column are relevant to the processing logic and from there, setup row context and accurately resolve any value expressions the processing may be interested in. An example of this has been added to the Selection example in Showcase.

        By moving value expression resolution to the app layer we break our dependency on the 'selectBy' field required for selection and makes this cell selection feature work for essentially any scenario. This new implementation eliminates alot of overhead that was required to synchronize the externally accessible CellSelection objects with an internal mapping of selections which had its own flaws. This feature is now 1/10th as long and avoids many risky behaviors the original implementation waded through.

        Cell selection is now accessible from the RowStateMap like other row-specific (row selection) and cell-specific (cell editor) table feature state.

        RowStateMap.getRowsWithSelectedCells -> List<Object>
        RowState.addSelectedColumn(Column)
        RowState.removeSelectedColumn(Column)
        RowState.setSelectedColumnIds(List<String>)
        RowState.getSelectedColumnIds() -> List<String>

        Revision #36622
        Committed by nils.lundquist
        Moments ago
        ICE-9411 / ICE-9384 - Simplified API for cell selection and unified with other row/cell features in RowState. Reworked selection and expansion so state changes take place in updateModel. Simplified and renamed showcase selection example.

        Show
        Nils Lundquist added a comment - Removed the following public cell selection methods from DataTable.java: removeSelectedCell(String); removeSelectedCells(String); addSelectedCell(String); addSelectedCells(String); getSelectedCells(); clearCellSelection(); In the previous implementation of cell selection, cells were passed to application bean logic as CellSelections objects. These objects contained a reference to the row object as well as 'extracted' field names from the value expression (selectBy) required on any column in a table using cell selection. This implementation was not very robust since the parsing of column value expressions for row object field names is misguided; a column value expression may access values that are not row object fields or have a complex relationship to the row object that cannot be parsed. It also precludes the selection of cells where there is no value expression. In these cases the information provided by the CellSelections object would be useless. This parsing of field names was desired so we could supply column values to the app dev seamlessly. This now appears misguided and unnecessary. It's easy enough for the app dev to know when writing selections processing, given a Column component and row model object, if the children of that column are relevant to the processing logic and from there, setup row context and accurately resolve any value expressions the processing may be interested in. An example of this has been added to the Selection example in Showcase. By moving value expression resolution to the app layer we break our dependency on the 'selectBy' field required for selection and makes this cell selection feature work for essentially any scenario. This new implementation eliminates alot of overhead that was required to synchronize the externally accessible CellSelection objects with an internal mapping of selections which had its own flaws. This feature is now 1/10th as long and avoids many risky behaviors the original implementation waded through. Cell selection is now accessible from the RowStateMap like other row-specific (row selection) and cell-specific (cell editor) table feature state. RowStateMap.getRowsWithSelectedCells -> List<Object> RowState.addSelectedColumn(Column) RowState.removeSelectedColumn(Column) RowState.setSelectedColumnIds(List<String>) RowState.getSelectedColumnIds() -> List<String> Revision #36622 Committed by nils.lundquist Moments ago ICE-9411 / ICE-9384 - Simplified API for cell selection and unified with other row/cell features in RowState. Reworked selection and expansion so state changes take place in updateModel. Simplified and renamed showcase selection example.
        Nils Lundquist made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Nils Lundquist made changes -
        Affects Documentation (User Guide, Ref. Guide, etc.),Sample App./Tutorial [ 10003, 10001 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36623 Wed Jul 10 13:53:33 MDT 2013 nils.lundquist ICE-9411 - Simplified API for cell selection and unified with other row/cell features in RowState.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTable.java
        Commit graph DEL /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/model/table/CellSelections.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/SelectionDeltaState.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/src/org/icefaces/ace/component/column/Column.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/model/table/RowState.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36628 Wed Jul 10 17:01:02 MDT 2013 nils.lundquist ICE-9411 / ICE-9384 - Simplified and renamed showcase selection example.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dataTable/dataTableSelector.xhtml
        Ken Fyten made changes -
        Summary Refactor cell selection to use RowState Refactor ace:dataTable cell selection to use RowState
        Hide
        Ken Fyten added a comment -

        Let's complete the JavaDoc for RowState to ease developer use of the APIs.

        Show
        Ken Fyten added a comment - Let's complete the JavaDoc for RowState to ease developer use of the APIs.
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36648 Thu Jul 11 15:58:07 MDT 2013 nils.lundquist ICE-9411 - Added javadoc to the RowState list manipulation methods.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/model/table/RowState.java
        Hide
        Nils Lundquist added a comment -

        Revision #36659
        Committed by nils.lundquist
        Moments ago
        ICE-9411 - Completed javadoc.

        Show
        Nils Lundquist added a comment - Revision #36659 Committed by nils.lundquist Moments ago ICE-9411 - Completed javadoc.
        Nils Lundquist made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #36659 Thu Jul 11 17:08:55 MDT 2013 nils.lundquist ICE-9411 - Completed javadoc.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/model/table/RowStateMap.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/model/table/RowState.java
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: