-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement multi selection in Grid #2522
Conversation
Review status: 0 of 11 files reviewed at latest revision, 1 unresolved discussion. a discussion (no related file): Comments from Reviewable |
Reviewed 11 of 11 files at r1. flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/Grid.java, line 321 at r1 (raw file):
Why ? flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/GridNoneSelectionModel.java, line 78 at r1 (raw file):
Does it confirm to the FW8 code ? I don't see why I can't add a listener to the model. I will never get events - that's the only difference. flow-data/src/main/java/com/vaadin/data/selection/SingleSelectionListener.java, line 48 at r1 (raw file):
new line Comments from Reviewable |
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. flow-data/src/main/java/com/vaadin/data/selection/MultiSelectionEvent.java, line 133 at r1 (raw file):
new line Comments from Reviewable |
Additionally adds shorthand methods to Grid for managing selection. Closes #2424
c6a386e
to
d8a1f76
Compare
Review status: 9 of 11 files reviewed at latest revision, 5 unresolved discussions. flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/Grid.java, line 321 at r1 (raw file): Previously, denis-anisimov (Denis) wrote…
Rows will get pushed again to the client, with the updated selection information. After #2524 is implemented this should really only call flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/GridNoneSelectionModel.java, line 78 at r1 (raw file): Previously, denis-anisimov (Denis) wrote…
Yes, FW8 also behaves in this way. You are right, but I don't think we should change it, especially with flow-data/src/main/java/com/vaadin/data/selection/MultiSelectionEvent.java, line 133 at r1 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. flow-data/src/main/java/com/vaadin/data/selection/SingleSelectionListener.java, line 48 at r1 (raw file): Previously, denis-anisimov (Denis) wrote…
Done. Comments from Reviewable |
Reviewed 4 of 4 files at r2. flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/Grid.java, line 321 at r1 (raw file): Previously, ahie (Aleksi Hietanen) wrote…
So the selection is a part of the item DTO ? Comments from Reviewable |
Review status: 9 of 13 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. a discussion (no related file): Previously, ahie (Aleksi Hietanen) wrote…
Considering creating a separate issue for select all and dynamically adding/removing a selection column on the client side. Currently the client side grid just blows up if you attempt to add a flow-components-parent/flow-components/src/main/java/com/vaadin/ui/grid/Grid.java, line 321 at r1 (raw file): Previously, denis-anisimov (Denis) wrote…
That's correct and also closer to how it was done in FW8 with data generators. Comments from Reviewable |
Reviewed 4 of 5 files at r3. Comments from Reviewable |
Reviewed 1 of 5 files at r3. Comments from Reviewable |
c64261b
to
25d1e02
Compare
Reviewed 3 of 4 files at r4. Comments from Reviewable |
|
||
@Override | ||
public MultiSelect<Grid<T>, T> asMultiSelect() { | ||
return new MultiSelect<Grid<T>, T>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -215,7 +257,170 @@ public Registration addValueChangeListener( | |||
MULTI { | |||
@Override | |||
protected <T> GridSelectionModel<T> createModel(Grid<T> grid) { | |||
throw new UnsupportedOperationException("Not implemented yet."); | |||
return new GridMultiSelectionModel<T>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new UnsupportedOperationException("Not implemented yet."); | ||
return new GridMultiSelectionModel<T>() { | ||
|
||
Set<T> selected = new LinkedHashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -191,6 +199,8 @@ public T getValue() { | |||
@Override | |||
public Registration addValueChangeListener( | |||
ValueChangeListener<Grid<T>, T> listener) { | |||
Objects.requireNonNull(listener, | |||
"listener cannot be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… into 2424-grid-multi-select
Review status: 10 of 15 files reviewed at latest revision, 5 unresolved discussions, some commit checks broke. a discussion (no related file): Previously, ahie (Aleksi Hietanen) wrote…
Created a new issue about this: #2546. Comments from Reviewable |
Reviewed 5 of 5 files at r5. Comments from Reviewable |
SonarQube analysis reported 5 issues Watch the comments in this conversation to review them. 1 extra issueNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
Reviewed 1 of 2 files at r6. Comments from Reviewable |
Additionally adds shorthand methods to Grid
for managing selection.
Closes #2424
This change is