Hi, Did you test against Vaadin 17? When I tried, it is giving an `Arithmet

Hi,
Did you test against Vaadin 17? When I tried, it is giving an ArithmeticException (/ by zero) error. I can’t make out much from the line numbers.

Any test code is failing:
Example:

new MultiselectComboBox<>("Test", Arrays.asList("One", "Two", "Three"));

Add to any layout and try to select an item.

Hi,

No, I have not tested with Vaadin 17. I can give it a closer look when I have more time. If you are able to resolve the issue, please let me know.

BR,

Goran

Hi,
I recompiled the code in Vaadin 17 and tried to run my sample code. Got the same error. So, I did some debugging and the error is coming from the method fetchFromProvider in DataCommunicator where it is doing a division operation with pageSize whose value is 0. So, some logic flow change of Vaadin 17 is executing that part of the code before pageSize is not yet set. So, the issue can be resolved by setting a default pageSize in the constructor of MultiselectComboBoxDataCommunicator class.

    public MultiselectComboBoxDataCommunicator(DataGenerator<T> dataGenerator, ArrayUpdater arrayUpdater, SerializableConsumer<JsonArray> dataUpdater,
                                               StateNode stateNode) {
        super(dataGenerator, arrayUpdater, dataUpdater, stateNode);
        setKeyMapper(uniqueKeyMapper);
        setPageSize(50); // Initialize a default page size
    }

Thanks for the findings Syam, I really appreciate it!

We’ll fix this in the framework too https://github.com/vaadin/flow/issues/9051

Thank you Pekka!

We run into the same issue and we can confirm that the issue is fixed with Vaadin 17.0.7 (which uses vaadin-flow 4.0.3), so no need for a workaround anymore.

Thank you

Thanks for the update Patrick!