Skip to content

Tree Grid Nested Hierarchy is not lazy #24388

@guygoldwasser

Description

@guygoldwasser

Description of the bug

Hi,
after migrate from vaadin 24 to 25.
In case having TreeGrid, and calculated childs,
and my tree model is infinite, it ends with infinite loop.

Shift to flatten hierarchy resolve the regression, but create new issue, where l&f is not nested anymore.
(it clear that hierarchy format influance both)

private List flatten (TreeDataProvider) is private and consist the recursive, so no good way to overcome the issue.

Expected behavior

I would not expect getChildren will call in recursion, with any of the formats, but maybe that was the idea.
so at least an option to keep nested l&f with lazy loading.

I would expect e.g. instead of
if (this.getHierarchyFormat().equals(HierarchyFormat.NESTED) || isExpanded || combinedFilter.isPresent())
having
if ((this.getHierarchyFormat().equals(HierarchyFormat.NESTED)) && (isExpanded || combinedFilter.isPresent()))

I see no point getChildCount brings the all way down, if we expand step by step

Minimal reproducible example

just create graph like model that loop back to some ancestor, and place it into tree grid

Versions

vaadin 25

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    🔎 Investigation

    Status

    📥Inbox - needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions