-
Notifications
You must be signed in to change notification settings - Fork 63
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
In Vaadin 13, Grid.asMultiSelect().select(Collection)) can throw a Javascript error (cannot select style of undefined) when pageSize is less than the collection size. #1283
Comments
For anyone else that comes across this issue, we are setting the page size for the grid to the size of the list such as:
I could see this being problematic when the list is huge but for our purposes this works for now. |
I came across the same issue. If I don't set setPageSize() the error goes away. |
Usually when you don’t setPageSize() it defaults to 50. So in your case maybe 50 is greater than the number of items in your list? |
I tested against the list size of 1 and 500 and the error does not show up if not using setPageSize(). |
Awesome, that will be helpful for us if we come across the problem again. Thanks! |
Tested DataProvider.withConfigurableFilter() and no errors. Hope this helps. |
still came across this error setting setPageSize to the list count is not a solution when using lazy loading unfortunately The error seems to happen only if i select an item BEFORE the table has finished rendering |
The original error This bug has been fixed by vaadin/web-components#3789 which landed in Vaadin 23.0.10. Closing. |
Description
In Vaadin 13 (Beta2) when using Grid.asMultiSelect().select(Collection) a JavaScript error is thrown if the row number of one of the elements to select is greater than the page size of the grid.
The stacktrace is:
Live Demo
Here is a repository with a simple demo:
https://github.com/campbellbartlett/vaadin-style-undefined-error
This demo uses the Vaadin Spring Boot template.
Steps to reproduce
Clone the repository linked above.
Run with mvn spring-boot:run
Open localhost:8080
Browsers Affected
This is my code:
When pageSize is less than numItems the error is thrown in the browser when opening the view.
The text was updated successfully, but these errors were encountered: