Search in sources :

Example 1 with PaginationEmptyBinder

use of io.jmix.ui.component.pagination.data.PaginationEmptyBinder in project jmix by jmix-framework.

the class AbstractDataGrid method setupPaginationDataSourceProvider.

public void setupPaginationDataSourceProvider() {
    if (pagination == null) {
        return;
    }
    DataUnit items = getItems();
    PaginationDataBinder provider;
    if (items instanceof ContainerDataUnit) {
        provider = applicationContext.getBean(PaginationDataUnitBinder.class, items);
    } else if (items instanceof EmptyDataUnit && items instanceof EntityDataUnit) {
        provider = new PaginationEmptyBinder(((EntityDataUnit) items).getEntityMetaClass());
    } else {
        throw new IllegalStateException("Unsupported data unit type: " + items);
    }
    pagination.setDataBinder(provider);
}
Also used : PaginationDataUnitBinder(io.jmix.ui.component.pagination.data.PaginationDataUnitBinder) PaginationEmptyBinder(io.jmix.ui.component.pagination.data.PaginationEmptyBinder) EmptyDataUnit(io.jmix.ui.component.data.meta.EmptyDataUnit) DataUnit(io.jmix.ui.component.data.DataUnit) EntityDataUnit(io.jmix.ui.component.data.meta.EntityDataUnit) ContainerDataUnit(io.jmix.ui.component.data.meta.ContainerDataUnit) EmptyDataUnit(io.jmix.ui.component.data.meta.EmptyDataUnit) PaginationDataBinder(io.jmix.ui.component.pagination.data.PaginationDataBinder) ContainerDataUnit(io.jmix.ui.component.data.meta.ContainerDataUnit) EntityDataUnit(io.jmix.ui.component.data.meta.EntityDataUnit)

Example 2 with PaginationEmptyBinder

use of io.jmix.ui.component.pagination.data.PaginationEmptyBinder in project jmix by jmix-framework.

the class AbstractTable method setupPaginationDataSourceProvider.

public void setupPaginationDataSourceProvider() {
    if (pagination == null) {
        return;
    }
    DataUnit items = getItems();
    PaginationDataBinder provider;
    if (items instanceof ContainerDataUnit) {
        provider = applicationContext.getBean(PaginationDataUnitBinder.class, items);
    } else if (items instanceof EmptyDataUnit && items instanceof EntityDataUnit) {
        provider = new PaginationEmptyBinder(((EntityDataUnit) items).getEntityMetaClass());
    } else {
        throw new IllegalStateException("Unsupported data unit type: " + items);
    }
    pagination.setDataBinder(provider);
}
Also used : PaginationDataUnitBinder(io.jmix.ui.component.pagination.data.PaginationDataUnitBinder) PaginationEmptyBinder(io.jmix.ui.component.pagination.data.PaginationEmptyBinder) EmptyDataUnit(io.jmix.ui.component.data.meta.EmptyDataUnit) DataUnit(io.jmix.ui.component.data.DataUnit) EntityDataUnit(io.jmix.ui.component.data.meta.EntityDataUnit) ContainerDataUnit(io.jmix.ui.component.data.meta.ContainerDataUnit) EmptyDataUnit(io.jmix.ui.component.data.meta.EmptyDataUnit) PaginationDataBinder(io.jmix.ui.component.pagination.data.PaginationDataBinder) ContainerDataUnit(io.jmix.ui.component.data.meta.ContainerDataUnit) EntityDataUnit(io.jmix.ui.component.data.meta.EntityDataUnit)

Aggregations

DataUnit (io.jmix.ui.component.data.DataUnit)2 ContainerDataUnit (io.jmix.ui.component.data.meta.ContainerDataUnit)2 EmptyDataUnit (io.jmix.ui.component.data.meta.EmptyDataUnit)2 EntityDataUnit (io.jmix.ui.component.data.meta.EntityDataUnit)2 PaginationDataBinder (io.jmix.ui.component.pagination.data.PaginationDataBinder)2 PaginationDataUnitBinder (io.jmix.ui.component.pagination.data.PaginationDataUnitBinder)2 PaginationEmptyBinder (io.jmix.ui.component.pagination.data.PaginationEmptyBinder)2