smartGWT: ListGrid setDataSource on a servlet

Posted by itit on Stack Overflow See other posts from Stack Overflow or by itit
Published on 2010-06-03T12:29:54Z Indexed on 2010/06/03 12:34 UTC
Read the original article Hit count: 704

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about servlets