I am trying to add checkboxes to a column in a listgrid with the following code. They show up as button instead.
protected Canvas createRecordComponent(final ListGridRecord record,
Integer colNum) {
String fieldName = this.getFieldName(colNum);
if (fieldName.equals("useCheckbox")) {
Button button = new Button();
button.setActionType(SelectionType.CHECKBOX);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
SC.say(record.getAttribute("department") + " improved chkbox state: " + ((Button)event.getSource()).getState());
}
});
return button;
} else {
return super.createRecordComponent(record, colNum);
}
}
protected Canvas createRecordComponent(final ListGridRecord record,
Integer colNum) {
String fieldName = this.getFieldName(colNum);
if (fieldName.equals("useCheckbox")) {
Button button = new Button();
button.setActionType(SelectionType.CHECKBOX);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
SC.say(record.getAttribute("department") + " improved chkbox state: " + ((Button)event.getSource()).getState());
}
});
return button;
} else {
return super.createRecordComponent(record, colNum);
}
}
Comment