Search in sources :

Example 1 with TableColumns

use of com.codename1.rad.nodes.TableColumns 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);
}
Also used : TableColumns(com.codename1.rad.nodes.TableColumns) EntityList(com.codename1.rad.models.EntityList) EntityListTableModel(com.codename1.rad.ui.table.EntityListTableModel)

Aggregations

EntityList (com.codename1.rad.models.EntityList)1 TableColumns (com.codename1.rad.nodes.TableColumns)1 EntityListTableModel (com.codename1.rad.ui.table.EntityListTableModel)1