Configure table row for user entry
How can enable or disable components in a particular row of a table? I've a a table binded to a db table and I've changed the layout to components like textfield instead staticfield and set disabled property to true for the key field,then when use add button:
RowKey id = tableDataProvider.appendRow(); tableDataProvider.setCursorRow(id);
then i want to enable the key field of the new row to let the user write in it. How can I do?Thank you
[463 byte] By [
gesioninga] at [2007-11-26 17:38:30]

# 1
Hi!
You can bind disable property of component to the property, which You should add to the page. For example:
private boolean disable;
public boolean isDisable() {
String value = (String) getValue("#{currentRow.value['value']}");
if (value ... ) disable = true;
else disable = false;
return this.disable;
}
Thanks,
Roman.
# 2
Ok, I cant set disable property binding of the textfield but all rows are affected, I only want it for the last row(the new one), in THE OTHERS rows the field must be disabled.Thanks