Skip to content

Grid with CallbackDataProvider selection didn't work on Dialog open #2354

Closed

Description

@lanmaster

Vaadin Flow 14.
I have a Button, on click it will:

  • open Dialog (if not opened) with Grid inside
  • in new Thread with UI.GetCurrent().access():
    • scroll to needed item in the Grid
    • select same needed item in the Grid

By button click:

  • if Dialog closed, then it opens, showing Grid, scrolling, but no select;
  • if Dialog already opened, then scrolling to item and select this item;

I tryed to use addAttachListener() and addOpenedChangeListener(), and make operations on Grid on that events, but no luck.

Where am i wrong?

Activity

  1. lanmaster commented on Nov 7, 2021

    @lanmaster
    Author

    Cannot reproduce on fresh project, will search in my code...

  2. lanmaster commented on Nov 7, 2021

    @lanmaster
    Author

    I found strange behavior when using CallbackDataProvider. If i use entities with overriden equals(0 and hashCode() it can select item, but when i use identifierGetter - it doesn't.
    Please look at that project:
    https://github.com/lanmaster/dialogwithgriddemo

  3. pleku commented on Nov 17, 2021

    @pleku

    The problem is in the selection model code in grid.
    The single selection model is not using the identifier provider twice:
    https://github.com/vaadin/flow-components/blob/master/vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/AbstractGridSingleSelectionModel.java#L63-L73

    For multiselect mode, it is working correctly
    https://github.com/vaadin/flow-components/blob/master/vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/AbstractGridMultiSelectionModel.java#L210

    As the issue is in the component integration code, transferring the issue to vaadin/flow-components repository

  4. transferred this issue fromvaadin/flowon Nov 17, 2021
  5. added 2 commits that reference this issue on Nov 17, 2021
    e462e14
    237aed5
  6. added a commit that references this issue on Feb 28, 2022
    e8bd54c
  7. added a commit that references this issue on Feb 28, 2022
    6e5610e
  8. added a commit that references this issue on Feb 28, 2022
    c9b74c2
  9. added a commit that references this issue on Feb 28, 2022
    3d26f39
  10. vaadin-bot commented on Mar 1, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 22.0.7.

  11. vaadin-bot commented on Mar 9, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with platform 23.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions