Repository navigation
fix: handle added and removed nodes when refreshing tree nodes - #5340
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
|
Also tagged #1027 as fixed. The OP doesn't provide a reproduction, so it's not clear what the original issue was. From testing I can confirm that updating, adding and removing direct children works. Nested hierarchical updates don't seem to work, but the |
| btn.addClickListener(event -> { | ||
| data.addItems("a", "a/a", "a/b"); | ||
| grid.getDataProvider().refreshItem("a"); | ||
| grid.getDataProvider().refreshItem("a", true); |
There was a problem hiding this comment.
NULL_DEREFERENCE: object returned by grid.getDataProvider() could be null and is dereferenced at line 39.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
| Command | Usage |
|---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
|
Kudos, SonarCloud Quality Gate passed!
|
* fix: handle added and removed nodes when refreshing tree nodes * use updated getCacheByKey * add ITs * use existing ITs instead * consistently refresh child items in IT page
| btn2.addClickListener(event -> { | ||
| data.addItems("a/a", "a/a/a", "a/a/c").addItem("a/a/a", "a/a/a/a"); | ||
| grid.getDataProvider().refreshItem("a/a"); | ||
| grid.getDataProvider().refreshItem("a/a", true); |
There was a problem hiding this comment.
NULL_DEREFERENCE: object returned by grid.getDataProvider() could be null and is dereferenced at line 44.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
| Command | Usage |
|---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
#5342) * fix: handle added and removed nodes when refreshing tree nodes * use updated getCacheByKey * add ITs * use existing ITs instead * consistently refresh child items in IT page Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
|
This ticket/PR has been released with Vaadin 24.2.0.alpha7 and is also targeting the upcoming stable 24.2.0 version. |








Description
Refreshing a tree node from the server while using the refresh children option currently leads to the grid not displaying the newly added child nodes. For updates initiated from the server, the current connector logic only handles updating existing child items / rows, but does not properly handle changes to the size of the parent item.
This fixes the connector to update the respective grid sub-cache size and effective grid size if it has changed, which causes grid to render the newly added items.
Fixes #5249
Fixes #1027
Type of change