ijingshan / gwt-charts

Automatically exported from code.google.com/p/gwt-charts
0 stars 0 forks source link

Custom AjaxLoader class causes problems when combining with standard AjaxLoader class #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently it's not really possible to combine gwt-charts and gwt-maps or 
gwt-maps-v3 because gwt-charts uses a custom AjaxLoader class. 
The problem is related to the nativeCreateCallback method: 

private static native boolean nativeCreateCallback() /*-{
    if ($wnd['google'] && $wnd.google['load']) {
       // The API has already been loaded.
       return true;
    }
    $wnd.__gwt_AjaxLoader_onLoad = function() {
           @com.googlecode.gwt.charts.client.ajaxloader.AjaxLoader::onLoadCallback()();
   }
   // The application must wait for a callback.
   return false;
}-*/;

the $wnd.__gwt_AjaxLoader_onload is overwritten either by gwt-charts or 
gwt-maps. This leads that the onLoadCallback of one of them is not loaded. 

Solution: 

Use a different variable name for $wnd (i.e. 
$wnd.__gwt_AjaxLoader_charts_onLoad) or use standard AjaxLoader class of 
google-gwt-apis 

Original issue reported on code.google.com by uemit.se...@gmail.com on 18 Jun 2013 at 8:46

GoogleCodeExporter commented 9 years ago
Renamed to `__gwt_AjaxLoader_onLoad` to `__gwt_charts_AjaxLoader_onLoad`

Original comment by rglafo...@gmail.com on 21 Aug 2014 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by rglafo...@gmail.com on 3 Sep 2014 at 11:07