Using MultipleSelect component causes error in browser for me. Can you instruct how to fix this, or would this be bug?
Please see attachment about details. End result is that list contents (text) come up to screen Ok, but component does not work.
Tested with Vaadin 14.4.2 (compability mode), Chrome 87.0.4280.66
Br., Janne
Sample Java code:
final ReportParam<List<DomainBase>> reportParam = new ReportParam<List<DomainBase>>(null, param);
final MultipleSelect<ListValue<DomainBase>> multipleSelect = new MultipleSelect<ListValue<DomainBase>>();
multipleSelect.setSizeFull();
multipleSelect.setId(param.getIdentifier());
multipleSelect.setItems(values);
multipleSelect.addSelectionListener(event -> {
final Set<ListValue<DomainBase>> list = event.getAllSelectedItems();
if (list != null && list.size() > 0) {
final List<DomainBase> tmp = new ArrayList<DomainBase>();
for (final ListValue<DomainBase> value : list) {
tmp.add(value.getValue());
}
reportParam.setValue(tmp);
} else {
reportParam.setValue(null);
}
});
multipleSelect.setLabel(resourceUtils.getText(param.getTextKey()));
multipleSelect.setEmptySelectionAllowed(false);
Thanks for the code! I saw the error when running your project. But when I copied your classes to a standard Vaadin project, the MultipleSelect component was rendered without a problem. This leads me to believe that the error has something to do with the specific setup of the project (not the component iteslf).
Could you please try running the attached project? It is a freshly downloaded 14.4.4 starter project to which I copy-pasted your classes. As you can see, if you run the project, the MultipleSelect component is rendered normally, which to my mind indicates that the issue has something to do with the specific setup of the project you are running (not the component iteslf). 18492600.zip (122 KB)
Yes, I confirm that works - but it’s not using compability mode.
I enabled compability mode for my-starter-project1, and found out that then error persists again.
Issue is that we would need compability mode for our product.
I attached modified pom.xml here for reference. Nothing else was changed.
I’ve updated the description of the component with this limitations.
Unfortunately the Java component is based on a Polymer 3 component which is not working in Vaadin 14 compatibility mode and there is no Polymer 2 version of the component.