Friday, July 22, 2011

AbstractDataProvider, JsArray, and java.util.List

Hello,

I've been working on a GWT project that integrates the CellTable
widget with remote services that provide JSON data.

So far, I have successfully created JavaScript Overlay Types and used
the JsonUtils.safeEval method to parse the returned JSON into either
an individual JavaScriptObject or a JsArray<JavaScriptObject>. I can
use the overlay type objects to access the data and populate various
widgets with no problems.

My problem came up when I tried to wire the JsArray as the data
provider for a CellTable. It seems that AbstractDataProvider has an
updateRowData method that is always looking for a java.util.List, and
my JsArray does is not a List. So far, I have been unable to find any
GWT provided mechanism to convert a JsArray as a List. I have seen
other code that uses a helper method to iterate through the JsArray
and add each item to a new List.

Has anyone else encountered this challenge? How did you (or would
you) approach it? Ay feedback is welcomed.

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate