I think you are getting confused between the 2 Java libraries. There's the data source library <http://code.google.com/p/google-visualization-java/> which is designed to be used in your server. And there's also the GWT<http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted>library which is compiled into client-side javascript.
On Mon, Feb 27, 2012 at 5:21 PM, GradualStudent <[email protected]> wrote: > Crossposting this open StackOverflow question, how to pass Google > DataTable objects from Java to Javascript, and vice versa? > > > http://stackoverflow.com/questions/9302314/passing-a-datatable-object-from-javascript-to-java/9459227#9459227 > > It seems it would be be a common task, but find references in this > group and elsewhere that it might not be so simple: > > * DataTable objects in Java and Javascript are not parallel, > When you say "Java", please specify which do you refer to, the data source library of the GWT library. * The JsonRenderer.renderDataTable(..) method in Java produces non- > standard Json .. can this be parsed in Javascript? > The javadoc is not updated. There's a new function<http://code.google.com/codesearch#aLJwv4TSmDw/trunk/src/main/java/com/google/visualization/datasource/render/JsonRenderer.java&l=242>that accepts an additional argument ( renderDateAsDateConstructor). Try to pass false to it. > * Is there a converse of JsonRenderer that consumes a standard JSON > string produced by Javascript and creates a Java DataTable? > Looking at the code<http://code.google.com/codesearch#aLJwv4TSmDw/trunk/src/main/java/com/google/visualization/datasource/datatable/DataTable.java>, it seems there isn't. > * Even the object passed back by query.send(...) can't be passed > directly to the Javascript DataTable constructor > I don't understand. Query.send calls your callback<http://code.google.com/apis/chart/interactive/docs/queries.html#Processing_the_Query_Response>with an already constructed DataTable. Does one need to write a JavaObject that directly corresponds to the > Javascript DataTable? Might that have been done? > I completely failed to understand this one... > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
