|
Editing cells |
|
Each table cell may be editable. In this case you can set pre-defined editor class that will be used during the edit process for the given column.
Example:
table.getTableDataModel().setCellEditable(1,1,true);
column1.setCellEditor("com.softaspects.jsf.renderer.table.cell.object.ObjectListBoxTableCellEditor"
)
See item "Setting different component types for different table columns" about predefined column classes and additional ready-to-use editors that may be used in editable cells.
Table implementation uses built-in validation for the compatibility of the data type in the data model for the column and the type of the editor that will be used in it. When setting the cell editor for the given column make sure that the types are compatible. Otherwise run-time exception will be thrown. For example you mayn't assign boolean based predefined editor for the numeric based table columns and vise versa.
You can easily develop your new editor that will be used in editable cells(see item "Developing new component types to be shown in table columns" for detail).