Monday, April 29, 2013

Re: CellTable created in onModuleLoad() doesn't draw until mouse moves over the browser window

1.) GWT can load JSON via JSONP by using JsonpRequestBuilder, in case you didn't know it.

2.) Try moving dataProvider.addDataDisplay() at the end of your setupTable code, so it gets executed after the table is actually added to the DOM (mainPanel.add(table)). As soon as you call dataProvider.addDataDisplay() the table will be rendered and once the table is attached to a data provider the table will update as soon as the data provider updates. So I would do:

a.) setup table and add it to the main panel

When JSON data is available
b.) fill ListDataProvider
c.) attach table to data provider

Alternatively you could also use/extend AsyncDataProvider which allows you do load your JSON data and fill the table asynchronously right inside the data provider.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment