Skip to content
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

Vaadin 14 - version 2.5.0 - Custom Values are not returned by getValue and getSelectedItems #101

Open
CrisVnait opened this issue Mar 18, 2022 · 0 comments

Comments

@CrisVnait
Copy link

I enabled adding custom values like:

public class CustomValueStringMultiselectComboBox extends MultiselectComboBox<String> {
    public CustomValueStringMultiselectComboBox(String label) {
        super(label);
        setItems(Collections.emptyList());
        setAllowCustomValues(true);
        addCustomValuesSetListener(e -> {
            LinkedHashSet<String> value = new LinkedHashSet<>(getValue());
            value.add(e.getDetail());
            setItems(value);
            setValue(value);
        });
    }
}

If I try to get values (via binder) it returns an empty list. Here v is during all states an empty collection.

binder.bind(telecommunicationMultiComboBox, d -> {
            telecommunicationMultiComboBox.setItems(d.getTelecommunicationSet());
            return d.getTelecommunicationSet();
        }, (d, v) -> {
            v = telecommunicationMultiComboBox.getSelectedItems();
            d.setTelecommunicationSet(v);
        });

Expected behavior is that custom values are returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant