hi all i need a simple example show me how to add column of ClickableTextCells to cellTable
thanks.
hi all i need a simple example show me how to add column of ClickableTextCells to cellTable
thanks.
Create a Column
overriding the onBrowserEvent
method.
Like this:
new Column<T, String>(new TextCell()) {
@Override
public String getValue(T object) {
return object.getProperty();
}
@Override
public void onBrowserEvent(Context context, Element elem, T object, NativeEvent event) {
// TODO You can check which event you want to catch
Window.open("http://www.stackoverflow.com", "StackOverFlow", "");
}
};
Column<YerValueObject, String> newCol = new Column<YerValueObject, String>(new ClickableTextCell()) {
@Override
public String getValue(YearValueObject obj) {
return obj.someMethod();
}
};
newCol.setFieldUpdater(new FieldUpdater<YerValueObject, String>() {
@Override
public void update(int index, YerValueObject obj, String value) {
//do whatever you need to here...
}
});
table.addColumn(newCol, "ClickColumn");
this is the solution if you need to add clickableTextCell to cellTable