private ContentType getUpdateEntity(FieldGroup binder) { final ContentTypeModel bean = ((BeanItem<ContentTypeModel>) binder.getItemDataSource()).getBean(); final ContentType contentType = new ContentType.Builder() .name(bean.getName()) .description(bean.getDescription()) .id(table.getValue().toString()) .build(); return contentType; }
@Override public void valueChange(Property.ValueChangeEvent event) { final Property property = event.getProperty(); if (property == table) { try { final ContentType contentType = contentTypeService.findById(table.getValue().toString()); final ContentTypeModel bean = getModel(contentType); form.binder.setItemDataSource(new BeanItem<>(bean)); setReadFormProperties(); } catch (Exception r) { } } }