[MGNLUI-1651] List view: selecting all items with the checkbox in the table header issues UnsupportedOperationException Created: 13/Jun/13  Updated: 29/Aug/13  Resolved: 14/Jun/13

Status: Closed
Project: Magnolia UI
Component/s: tree/list
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Bug Priority: Critical
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
supersession
is superseded by MGNLUI-1995 Add "select all" checkbox to top of v... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: RC 2

 Description   

In the list view, selecting all items with the checkbox in the table header issues UnsupportedOperationException: info.magnolia.ui.workbench.list.FlatJcrContainer does not support this method.

After some investigation I came up with four options

  • 1: JCR query for all elements
    public Collection<String> getItemIds() {
            ...
                QueryResult result = executeQuery(getQuerySelectStatement(), Query.JCR_JQOM, 0, 0);
            ...
        } 
    • Drawbacks: Returning 536 items between 8 to 17 ms (according to my rough measurements) - Visible delay in the UI - resources consuming? Using limit and offset (last two args of executeQuery) as we do in AbstractJcrContainer.getPage() does not select all the visible items but, apparently, some of them randomly
  • 2: Return empty collection - looks broken as no items get selected but still better than the error message
  • 3: Disable checkbox in table header
  • 4: using Vaadin’s ContainerHelpers.getItemIdsUsingGetIdByIndex(0, size()...)
    • looks faster than the JCR query approach (about 1ms to fetch the ids) still the rendering on the UI seems as slow as in option one and the method is not recommended in production by Vaadin itself.

Eventually, we settled for option 3 and will re-introduce the "select all" option later on after finding a solution to the slow rendering issue.



 Comments   
Comment by Federico Grilli [ 14/Jun/13 ]

Reviewed by Andreas.

Generated at Mon Feb 12 08:48:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.