Hi,
I have a table with multiedit feature. But is it possible to limit certain colums to be not editable in the multiedit mode?
Hi,
I have a table with multiedit feature. But is it possible to limit certain colums to be not editable in the multiedit mode?
Hi!
You could make certain columns read only by providing a custom FieldFactory. The Table component uses a FieldFactory to create the fields used for editing the data and the default FieldFactory creates editable fields for all columns.
You can provide your own FieldFactory like this:
table.setFieldFactory(new MyFieldFactory());
And MyFieldFactory that sets read only mode on the column with propertyID == “readOnlyColumn”:
public class MyFieldFactory extends BaseFieldFactory {
@Override
public Field createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Field field = createField(container.getContainerProperty(itemId, propertyId),
uiContext);
if ("readOnlyColumn".equals(propertyId)) {
field.setReadOnly(true);
}
return field;
}
}
You can actually return any field from the createField method.
HTH,
Jonatan
Thank you and it worked.