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

        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.
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: