Monday 15 March 2010

Endless loop in smartGWT listgrid retrieving data from REST back end

So you have written your DataSource, instantiated your ListGrid and tested the calls to your back end REST (e.g. Rails controller) in your browser. You know that the back end is delivering the data in correct JSON, but yet your smartGWT is looping endlessly, loading the data.

The console shows no errors but loads of RPC calls.

Check your record XPath in your DataSource.The value given for the call to setRecordXPath must match precisely the JSON data path. If you get this wrong, smartGWT fails silently, looping forever attempting to get the records and it knows from the meta data should be there!