I think wicket-ajax.js is choking, because the XMLHttpRequest to google is send while the XMLHttpRequest to the wicket-server, that brought in the script, is still processed.

But I'm still debugging, hints are appreciated,

Martin

Martin Funk wrote:
Hi Wicketeers,

currently I'm reevaluating http://wicketstuff.org/jira/browse/WSGMAPP-10
couse I'm not so sure if my assumptions were right.

But now I got stuck in a place were I'd like to ask for a second view.

As it may not be a big surprise GMap2 heavily relies on googles jsapi.

In a normal case it gets loaded with a

<script type="text/javascript" src="http://www.google.com/jsapi?key=yourkey";></script>

tag in the header section of the html page.

How ever if it is tried to load that jsapi from within a ajax call this doesn't work.

So far I thought this is because google doesn't like XMLHttpRequests and simply doesn't answer, but right now I get the impression that this http get call from within the ajax request never leaves the browser.

My testing environment is current wicket from trunk and current wicket-contrib-gmap2 and -examples from wicket stuff.

The 'many' example in the examples currently works, because the <script> tag given above is added right away when loading the page.

To get to the state were the 'ajax bug' shows up you need to uncomment a line in the example:

--- src/main/java/wicket/contrib/examples/gmap/many/ManyPage.java (Revision 4283) +++ src/main/java/wicket/contrib/examples/gmap/many/ManyPage.java (Arbeitskopie)
@@ -46,8 +46,10 @@
        // the depth of wicket-ajax.js.
        // The GMapHeaderContributor needs to be present in a page if it
        // potentially might initialize a GMap2 component.
-        container
- .add(new GMapHeaderContributor(GMapExampleApplication.get().getGoogleMapsAPIkey()));
+        // container
+        // .add(new
+ // GMapHeaderContributor(GMapExampleApplication.get().getGoogleMapsAPIkey
+        // ()));
        add(container);



With that patch no maps show up in the 'many' example when you click on 'Create one more'

I used Firebug (for firefox) and tcpmon from Axis to monitor the TCP traffic. Using that I couldn't see that the call the call to googles jsapi is ever placed.

The ajax call to the app-server is placed fine and 'wicket ajax debug' shows how the diff is received.

The last trace of the http get call I'm locking for was on line 839 of wicket-ajax.js

                t.open("GET", url, this.async);

with an url value of "http://www.google.com/jsapi?key=ABQIAAAAzaZpf6nHOd9w1PfLaM9u2xQRS2YPSd8S9D1NKPBvdB1fr18_CxR-svEYj6URCf5QDFq3i03mqrDlbA";

But it never leaves firefox, or at least I don't see it.

Could someone confirm this or give me a little help?

Martin




Reply via email to