GWT Visualization best practice
I'm new with Google Visualization for GWT and I need help. Can someone tell me which is best pratice to transfer DataTable (data for visualization) with GWT RPC. Cause DataTable is not serializable, and I have a lot of data. I want to use GWT RPC cause I use Java on the server side. I know there is DataTable.toJson method in visualization package, but Its not yet wrapped into gwt.visualization package. I tried it, on my own, to wrap it with JSNI into my GWT code, but I didn't succeed. Does anyone succeed, or is ther开发者_JS百科e any diffrent approach to solve this problem.
Thanks
What I did is to send the data from the server to the client and create the DataTable object in client side.
I think this is the less dirty method :)
The problem with that is, that its unbelievable slow...
I tried to add ~800 values to an AnnotatedTimeline
and it took some 10.5 seconds to redraw it. The chrome network analytic tool says the request to the server took 200ms.. the rest of the time was lost while creating the datatable on the client side..
The usual way is to use a query object to get the data. this object will do all the datatable creation for you.. But I still didn't find a way to send such a query without writing the whole URL into a single string.. IMHO there should be some way to do something like an RPC call... But there seem to be no good tutorials on this on the web... Or maybe I'm getting something wrong :)
I think the 'Query' object is the best way to get a datatable. Create a datasourceservlet and get the datatable using the response.getDataTable() method. An example here.
精彩评论