Skip to content

setSelectionMode must not be called after setSelectionFilter #12

@javier-godoy

Description

@javier-godoy

The recipe for conditional selection requires a server-side check in order to discard selections that are not perfomed through the item click listener (which already does its own filtering).

However, grid.addSelectionListener() is just a shorthand for grid.getSelectionModel().addSelectionListener() and the selection listener is lost after a call to grid.setSelectionMode().

This limitation implies that GridHelpers.setSelectionFilter must be called after grid.setSelectionMode. If you need to change the selection mode, you need to set the same selection filter again:

GridHelper.setSelectionFilter(grid, GridHelper.getSelectionFilter(grid)); // static call
grid.setSelectionFilter(grid.getSelectionFilter()); // with lombok extension

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions