Repository navigation
feat: pass clicked column to grid context menu dynamic content provider - #10331
Merged
Merged
Conversation
…ntent handler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a GridContextMenu#setDynamicContentHandler overload whose callback receives both the clicked item and the clicked column. Also update the context menu target item and column before running the dynamic content handler, so that they are no longer one click behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Artur-
reviewed
Oct 4, 2026
Artur-
reviewed
Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Artur-
reviewed
Oct 4, 2026
Artur-
marked this pull request as ready for review
October 4, 2026 06:08
vaadin-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the changes — left 1 comment.
| Finding | |
|---|---|
| 📐 | New setter has no getter, and the only existing getter is deprecated for removal |
…andler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…provider Replace the (item, column) setDynamicContentHandler overload with setDynamicContentProvider, which receives a DynamicContentContext record. New context information can then be added later without new overloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sissbruecker
reviewed
Oct 5, 2026
… content handler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sissbruecker
approved these changes
Oct 5, 2026
|
Collaborator
|
This ticket/PR has been released with Vaadin 25.4.0-alpha3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Review risk: two-way door — additive API on
GridContextMenuplus deprecation of the item-only dynamic content handler.Summary
The dynamic content handler of
GridContextMenuonly received the clicked item, so there was no supported way to know which column was right-clicked when building the menu.This adds a dynamic content provider that receives a context record with the clicked item and column, which enables context menus whose items depend on the column that was right-clicked:
What changed
GridContextMenu#setDynamicContentProvider(SerializablePredicate<DynamicContentContext<T>>)/getDynamicContentProvider()and theGridContextMenu.DynamicContentContext<T>(T item, Grid.Column<T> column)record.columnisnullwhen the click doesn't target an application column (e.g. the selection column),itemisnullwhen it doesn't target an item (e.g. a header). The column is resolved from its internal id, so it works withoutColumn#setId. Passing a record allows adding more context later without new overloads.setDynamicContentHandler(SerializablePredicate)andgetDynamicContentHandler()are deprecated for removal in favor of the provider. Their behavior is unchanged. Setting a handler and setting a provider replace each other.Test summary
nullfor non-application columns; handler and provider replace each other.API Changes
Fixes #2258
🤖 Generated with Claude Code