Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Viritin MGrid FilterableListContainer IndexOutOfBoundsException
Hi Matti,
I am using MGrid for lazyloading which works fine. I use FilterableListContainer to support my FilterBar which works perfectly well on normal Grids. Somehow I am getting following error on moving to MGrid
Jan 26, 2017 12:05:13 AM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
at org.vaadin.viritin.LazyList.get(LazyList.java:209)
at org.vaadin.viritin.LazyList$1.next(LazyList.java:312)
at org.vaadin.viritin.FilterableListContainer.applyFilters(FilterableListContainer.java:79)
at org.vaadin.viritin.FilterableListContainer.filterContainer(FilterableListContainer.java:72)
at org.vaadin.viritin.FilterableListContainer.addFilter(FilterableListContainer.java:50)
at org.vaadin.viritin.FilterableListContainer.addContainerFilter(FilterableListContainer.java:173)
at com.aahar.ui.design.grid.filter.FilterComponent.filterListner(FilterComponent.java:130)
Could you please tell me how to fix it?
This is my pretty standard lazyloadingfrom function
getGrid().lazyLoadFrom(new SortablePagingProvider<AggrFoodList>() {
private static final long serialVersionUID = 1L;
@Override
public List<AggrFoodList> findEntities(int firstRow, boolean sortAscending, String properties) {
return aggrFoodListRepos.findAll(new PageRequest(firstRow, PAGESIZE, sortAscending ? Sort.Direction.ASC : Sort.Direction.DESC, properties == null ? "id" : properties)).getContent();
}
}, new CountProvider() {
private static final long serialVersionUID = 1L;
@Override
public int size() {
return (int)aggrFoodListRepos.count();
}
}, PAGESIZE);
thanks
Chahat
Last updated on
You cannot reply to this thread.