In my application, I want to disable editing of a row in a table if certain conditions are met. I saw “addEnabledRule” in the BaseAction class but that seems to apply to buttons attached to tables. I want to set editable(false) for columns in certain rows and editable(true) for others.
I tried this on the datasource attached to the table, but it does not work. I can still modify the rows that should be read only.
updtransDs.addItemPropertyChangeListener(e -> {
Updtrans updtrans = e.getItem();
if (updtrans != null) {
pinTable.scrollTo(updtrans);
if (updtrans.getUpdatedate() != null) {
pinTable.getColumn("mailfile").setEditable(false);
} else {
pinTable.getColumn("mailfile").setEditable(true);
}
}
});
Can this be done? How can I make some rows readonly and others editable?