import com.groupstp.rtneo.entity.*;
import com.groupstp.rtneo.web.gui.ds.ChangeQueryRelatedEntityDataProvider;
import com.groupstp.rtneo.web.util.WorkflowUiHelper;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.Table;
import org.apache.commons.lang.StringUtils;
import java.text.DecimalFormat;
import com.haulmont.cuba.core.entity.Entity;
import com.haulmont.cuba.core.global.DataManager;
return new Table.ColumnGenerator<ChangeQuery>() {
final ChangeQueryRelatedEntityDataProvider dsProvider = ((Table) target).getDatasource().getDataSupplier()
DataManager dataManager = AppBeans.get(DataManager.NAME)
@Override
public Component generateCell(ChangeQuery change) {
String value = StringUtils.EMPTY
RealEstateContainerYard cy = null
try{
Entity e = dsProvider.getReferenceEntity(change)
if(e instanceof RealEstateContainerYard && e != null){
cy = (RealEstateContainerYard)e
cy = dataManager.reload(cy, "realEstateContainerYard-edit")
}
if (cy != null) {
def code = cy.getContainerYard().getCode()
if (code != null) {
value = code
}
}
}catch (Exception ex){
value = ''
}
return new Table.PlainTextCell(value)
}
}