Is there something like a multi-SelectBox, or a multi-Select Combobox?
How can I bind an entity-Collection to a multiselect combobox-field?
I have implement an abstract dataProvider
public static <T extends AbstractEntity> DataProvider<T,Void> getDataProviderForEntityClass(Class<T> entityClass,CrudEntityServiceInterface crudService) {
return DataProvider.fromCallbacks(
// First callback fetches items based on a query
query -> {
// The index of the first item to load
int offset = query.getOffset();
// The number of items to load
int limit = query.getLimit();
List<QuerySortOrder> sortOrders = query.getSortOrders();
Page<AbstractEntity> entities = crudService
.fetchEntities(offset, limit, sortOrders);
//Cast CrudEntity to EntityClass
return (Stream<T>) entities.stream().map((item) -> { return convertInstanceOfObject(item, entityClass);});
},
// Second callback fetches the number of items for a query
query -> crudService.count()
);
}
which isn't applicable for a combobox.setDataprovider()... How should the setDataProvider looks like?