List of usage examples for com.vaadin.v7.ui AbstractSelect getContainerProperty
@Override
public Property getContainerProperty(Object itemId, Object propertyId)
From source file:com.haulmont.cuba.web.gui.components.table.CalculatableColumnGenerator.java
License:Apache License
protected com.vaadin.ui.Component generateCell(AbstractSelect source, Object itemId, Object columnId) { CollectionDatasource ds = table.getDatasource(); MetaPropertyPath propertyPath = ds.getMetaClass().getPropertyPath(columnId.toString()); PropertyWrapper propertyWrapper = (PropertyWrapper) source.getContainerProperty(itemId, propertyPath); com.haulmont.cuba.gui.components.Formatter formatter = null; Table.Column column = table.getColumn(columnId.toString()); if (column != null) { formatter = column.getFormatter(); }/*from w w w.j av a 2 s . c om*/ com.vaadin.ui.Label label = new com.vaadin.ui.Label(); setLabelText(label, propertyWrapper.getValue(), formatter); label.setWidthUndefined(); //add property change listener that will update a label value propertyWrapper.addListener(new CalculatablePropertyValueChangeListener(label, formatter)); return label; }