I found solution using OpenLayers.LoadURL:<br><br> var selFeature;<br><br> control.events.register("featureselected", this, function(e) {<br> var url = '<a href="http://www.domain.com/servlet'+e.feature.attributes.id">http://www.domain.com/servlet'+e.feature.attributes.id</a>;<br>
selFeature = e.feature;<br> OpenLayers.loadURL(url, '', e, createPopup);<br> OpenLayers.Event.stop(e);<br> });<br><br> var createPopup = function(response) {<br>
popup = new GeoExt.Popup({<br> title: 'My Popup',<br> feature: selFeature,<br> width:200,<br> html: response.responseText, // feature.attributes.sid, //bogusMarkup, theHtml <br>
maximizable: false,<br> collapsible: true<br> });<br><br><br><div class="gmail_quote">2010/6/3 Alex Zeit <span dir="ltr"><<a href="mailto:zeitalex@googlemail.com">zeitalex@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">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" target="_blank">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" target="_blank">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=%27+" target="_blank">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><font color="#888888">Alex<br>
</font></blockquote></div><br>