use of io.jmix.ui.data.impl.EntityDataItem in project jmix-docs by Haulmont.
the class EntityData method onInit.
@Subscribe
protected void onInit(InitEvent event) {
ListDataProvider dataProvider = new ListDataProvider();
dataProvider.addItem(new EntityDataItem((Entity) valueDescription(75, "Sky")));
dataProvider.addItem(new EntityDataItem((Entity) valueDescription(7, "Shady side of pyramid")));
dataProvider.addItem(new EntityDataItem((Entity) valueDescription(18, "Sunny side of pyramid")));
chart.setDataProvider(dataProvider);
}
use of io.jmix.ui.data.impl.EntityDataItem in project jmix by jmix-framework.
the class PivotTableDataItemsSerializer method getFormattedValueByEntityDatatype.
protected Optional<String> getFormattedValueByEntityDatatype(DataItem item, String property, Object value) {
if (item instanceof EntityDataItem) {
EntityDataItem entityItem = (EntityDataItem) item;
MetaClass metaClass = metadata.getClass(entityItem.getItem());
MetaPropertyPath mpp = resolveMetaPropertyPath(metaClass, property);
if (mpp != null) {
return Optional.of(mpp.getRange().asDatatype().format(value, getUserLocale()));
}
}
return Optional.empty();
}
Aggregations