Dear All,<br>I am trying to create Popup with HTML content that is generated by servlet and transferred with XMLHttpRequest.<br>Unfortunately the Popup is returned empty. Do I need special synchronisation for Popup to wait until request transfer HTML completely? (see <a href="http://hboard.iwk.uni-karlsruhe.de:8080/QuickStartWicket/qswicket/?wicket:bookmarkablePage=:wicketqs.RegioNoGM">http://hboard.iwk.uni-karlsruhe.de:8080/QuickStartWicket/qswicket/?wicket:bookmarkablePage=:wicketqs.RegioNoGM</a>)<br>
The popup is also looks different from one in example at <a href="http://dev.geoext.org/trunk/geoext/examples/popup.html">http://dev.geoext.org/trunk/geoext/examples/popup.html</a><br><br><br>select = new OpenLayers.Layer.Vector("Selection", {styleMap: <br>
new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])<br>});<br><br>control = new OpenLayers.Control.GetFeature({<br> protocol: new OpenLayers.Protocol.WFS.v1_1_0({...}),<br>});<br><br>control.events.register("featureselected", this, function(e) {<br>
select.addFeatures([e.feature]);<br>var txt = doRequest('<a href="http://hboard.iwk.uni-karlsruhe.de:8080/QuickStartWicket-1.0-SNAPSHOT/qswicket/?wicket:bookmarkablePage=:wicketqs.Page1&username='+">http://hboard.iwk.uni-karlsruhe.de:8080/QuickStartWicket-1.0-SNAPSHOT/qswicket/?wicket:bookmarkablePage=:wicketqs.Page1&username='+</a>"test");<br>
createPopup(e.feature, txt);<br> });<br><br>map.addControl(control);<br>control.activate();<br><br>function createPopup(feature, htmlText) {<br> popup = new GeoExt.Popup({<br> title: 'My Popup',<br>
feature: feature,<br> width:200,<br> html: htmlText, <br> maximizable: false,<br> collapsible: true<br> });<br> popup.show();<br>}<br><br>function doRequest(servletName){<br> var request = addrequest(servletName); //calls the addrequest function<br>
request.onreadystatechange = function(){ //this is used to listen for changes in the request's status<br> if (request.readyState == 4) {<br> if (request.status == 200) {<br> var htmlTxt = request.responseText;<br>
return htmlTxt;<br> }<br> }<br> }<br>}<br><br>function addrequest(req) {<br> var request;<br> try { //create a request for netscape, mozilla, opera, etc.<br>
request = new XMLHttpRequest();<br> }catch (e) {<br><br> try { //create a request for internet explorer<br> request = new ActiveXObject("Microsoft.XMLHTTP");<br> }catch (e) { //do some error-handling<br>
alert("XMLHttpRequest error: " + e);<br> }<br> }<br><br> request.open("GET", req, true); //prepare the request<br> request.send(null); //send it<br> return request; //return the request<br>
}<br><br><br>Any help would be highly appreciated<br>Alex<br>