package pt.ist.vaadinframework.example.ui; import java.util.Arrays; import pt.ist.vaadinframework.example.domain.ExampleRoot; import pt.ist.vaadinframework.example.domain.Person; import pt.ist.vaadinframework.ui.TxForm; import pt.ist.vaadinframework.ui.TxForm.FormStyle; import com.vaadin.data.util.DomainItem; import com.vaadin.ui.CustomComponent; @SuppressWarnings("serial") public class DomainForms extends CustomComponent { @Override public void attach() { super.attach(); DomainItem item = new DomainItem(Person.class); item.getItemProperty("stuff").setPossibleValues(ExampleRoot.getInstance().getStuffSet()); item.getItemProperty("precious").setPossibleValues(ExampleRoot.getInstance().getStuffSet()); item.getItemProperty("name").setReadOnly(true); TxForm form = new TxForm(FormStyle.SAVE_CLEAR_CANCEL); // Collection props = new ArrayList(); // props.addAll(item.getItemPropertyIds()); // props.remove("root"); form.setItemDataSource(item, Arrays.asList("name", "stuff", "precious")); setCompositionRoot(form); } }