I have a GWT CellTable<MyType>. This table have rows which should display a CheckBox. This CheckBox should checked or unchecked depending on a getter in MyType, but it should disabled so the user can’t click it. Does anybody know how this could be implemented?
Some code snippets:
Column<MyType, Boolean> checkboxColumn = new Column<MyType, Boolean>(new CheckboxCell()) {
@Override
public Boolean getValue(MyType object) {
return object.isItTrue();
}
};
CellTable<MyType> cellTable = new CellTable<MyType>();
cellTable.addColumn(checkboxColumn, "Header title");
CheckboxCelldoes not support this functionality, but you can make your own cell that does. Untested code (copied largely from theCheckboxCellcode, Copyright Google (seeCheckboxCellsource for license)) follows! The important part is in the render code. Your new cell would go in aColumn<MyType, MyType>.