tf.setEnabled(false);
twoLayout.addComponent(tf);
form = new Form();
form.setCaption("Enabled");
form.setFormFieldFactory(new DefaultFieldFactory() {
@Override
public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
Field<?> f = super.createField(item, propertyId, uiContext);
f.setEnabled(!"disabled".equals(propertyId));
return f;
}
});
form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
content.addComponent(form);
table = new Table("Enabled");
table.setPageLength(7);
table.addContainerProperty("Text", String.class, null);
for (int i = 0; i < 150; i++) {
Item item = table.addItem("Item" + i);
Property<String> p = item.getItemProperty("Text");
p.setValue(i % 5 == 0 ? "enabled" : "disabled");
}
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Field<?> f = super.createField(container, itemId, propertyId,