Skip to content

Grid: cannot bind selection to signal #8920

@stefanuebe

Description

@stefanuebe

Description

I tried to bind the selection to a signal, but that fails with an exception:

Caused by: java.lang.UnsupportedOperationException: Binding value to a Signal is not supported by 
	at com.vaadin.flow.component.HasValue.bindValue(HasValue.java:312)

Expected outcome

Grid selection should support signals via bindValue.

Minimal reproducible example

public class GridView extends VerticalLayout {

    public GridView(UserSettings userSettings) {

        Grid<Object> grid = new Grid<>();
        grid.setSelectionMode(Grid.SelectionMode.MULTI);
        var signal = new ValueSignal<Set<Object>>(new HashSet<>());
        grid.asMultiSelect().bindValue(signal, signal::set);
    }
}

Steps to reproduce

Add the snippet and open the respective view. It will fail immediately

Environment

Vaadin version(s): 25.1.0-beta3

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions