I’m not able to use the “setValue” method. It seems it is ignored. Can you help me? Thanks
Hello, the implementation is wrong. I created an issue on GitHub about that https://github.com/FlowingCode/ChipFieldAddon/issues/25
Hi Matteo!
Yesterday we released [a new version]
(https://vaadin.com/directory/component/chipfield-addon/2.3.0) of the component that solves this issue among others, can you give it a try?
Regards!
Hello, now the setValue works fine. Thank you!
I have another problem with the setDataprovider and setItems methods. I can’t see the values loaded and of course i’m not capable to add new values. Can you check that?
Hi Matteo,
Are you providing an ItemLabelGenerator in the ChipField constructor?
If this is the case, can you please check the addon demos [here]
(https://addonsv14.flowingcode.com/chipfield) (The Data Provider demo uses setDataprovider and the Binder demo uses setItems), and see if there are significant differences? Or can you provide your code so we can replicate the bug?
Thanks!
ChipField<SerialNumber> chipNumber = new ChipField<>("Serial Number", SerialNumber::getCode);
chipNumber.setDataProvider(numberService.createDataProvider());
chipNumber.setValue(entity.getSerialNumbers());
This is what i do to populate the component. And it works fine in version 2.3.0. But the ‘addValueChangeListener’ isn’t working.
Hello, [version 2.4.0]
(https://github.com/FlowingCode/ChipFieldAddon/releases/tag/chipfield-addon-2.4.0) introduces several fixes related to handling new values and firing ValueChangeEvent.
(particularly [#48]
(https://github.com/FlowingCode/ChipFieldAddon/issues/48): events are not fired when the value is modified from server side).
Can you test your code with that version? If it doesn’t work, please create an issue in the repository and we’ll take a look.