CELLTABLE in GWT
How to use GWT CellTable for the following Layout
Each row开发者_JS百科 has a checkBox and a Label/HTML content.
Thanks in Advance.
Firstly, create a class like that
public class MyObject{
private CheckBox checkBox;
private HTML html;
public Contact(CheckBox checkBox, HTML html) {
this.checkBox = checkBox;
this.html = html;
}
// getter & setter
}
after that create cell table
CellTable<MyObject> cellTable = new CellTable<MyObject>();
then create columns
TextColumn<MyObject> firstColumn = new TextColumn<MyObject>() {
@Override
public CheckBox getValue(MyObject object) {
return object.getCheckBox;
}
};
cellTable.addColumn(firstColumn , "Checkbox");
and second column
TextColumn<MyObject> secondColumn = new TextColumn<MyObject>() {
@Override
public HTML getValue(MyObject object) {
return object.getHtml;
}
};
cellTable.addColumn(secondColumn , "HTML");
精彩评论