This is in scope of migration from cuba to jmix
I have a lot of entities extending other entities.
For each I need a browser and editor window, for editors I use fragments to promote reuse.
For the browsers I have a utility class that adds columns for common properties based on MetaPropertyPath. I don’t see a direct replacement for this in jmix.
I would assume something with a EntityValueSource, but I don’t find a way to create instances given an entity…
cuba (not supported in jmix) code :
private void someFunctionThatWillAddTheInvididualColumns() {
properties.put("Status", "status");
properties.put("Series Identifier", "series.identifier");
properties.put("Series", "series.description");
properties.forEach(this::addColumn);
}
private void addColumn(String caption, String path) {
MetaClass abstractPartMeta = metadata.getClass(AbstractPart.class);
MetaPropertyPath propertyPath = abstractPartMeta.getPropertyPath(path);
getTable().addColumn(new Table.Column<>(propertyPath, caption), 0);
}