use of com.codename1.rad.propertyviews.TablePropertyView in project CodeRAD by shannah.
the class TablePropertyView method update.
@Override
public void update() {
super.update();
EntityListTableModel model = (EntityListTableModel) getComponent().getModel();
EntityList list = model.getEntityList();
EntityList ePropertyVal = getPropertyAsEntityList();
if (ePropertyVal == list) {
return;
}
TableColumns columns = (TableColumns) getField().findAttribute(TableColumns.class);
if (columns == null) {
throw new IllegalStateException("Cannot create TablePropertyView for field " + getField() + " because the field does not define any columns. Add a ColumnsNode attribute to the field.");
}
EntityListTableModel newModel = new EntityListTableModel(list.getRowType(), ePropertyVal, columns);
getComponent().setModel(newModel);
}
use of com.codename1.rad.propertyviews.TablePropertyView in project CodeRAD by shannah.
the class TablePropertyView method getPropertyAsEntityList.
private EntityList getPropertyAsEntityList() {
Object propertyVal = getEntity().getEntity().get(getProperty());
if (!(propertyVal instanceof EntityList)) {
throw new IllegalStateException("TablePropertyView only supports EntityList properties");
}
EntityList ePropertyVal = (EntityList) propertyVal;
return ePropertyVal;
}
Aggregations