smartGWT: ListGrid setDataSource on a servlet
- by itit
I want to setDataSource of my ListGrid on response received from my java servlet.
For example:
request = builder.sendRequest(null, new RequestCallback() {
public void onResponseReceived(Request request, Response response) {
if(200 == response.getStatusCode())
{
final ListGrid countryGrid = new ListGrid();
countryGrid.setWidth(300);
countryGrid.setHeight(450);
countryGrid.setAlternateRecordStyles(true);
countryGrid.setShowFilterEditor(true);
countryGrid.setFilterOnKeypress(true);
countryGrid.setDataSource(Frequenze.getInstance());
countryGrid.setAutoFetchData(true);
ListGridField wordField = new ListGridField("word", "Word");
ListGridField frequenceField = new ListGridField("frequence", "Frequece");
countryGrid.setFields(wordField, frequenceField);
countryGrid.setDataSource(dataSource); // ??
...
How can I fill the servlet response in the ListGrid?