[OpenLayers-Users] Include drop down box in popup that contains query result

Arnd Wippermann arnd.wippermann at web.de
Mon Jul 28 13:24:39 EDT 2008


Hi Reena,

You can place in the HTML for the popup an empty element for the second drop
down list. When you have your results and build dynamicly the HTML for this
drop down list (or the request returns the HTML for this), you can insert
the HTML to your popup. 

document.getElementById("emptyElement").innerHTML = resultsHTML;

To get your results you have to create the url for your GetFeatureInfo
request appropriate to the select of the first drop down list, start an ajax
call with this url and with the response create the HTML for the second
list.

MfG
Arnd Wippermann


-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von S.Reena
Gesendet: Montag, 28. Juli 2008 00:25
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Include drop down box in popup that contains
query result


Hi,
I am still not very sure of this...Here is the code of my pop up...Can you
tell me where exactly I need to make modifications.... 
               Here I have made one drop down box and I want that when one
element is selected in this....second drop down box having the query results
should come beside it...


function search()
	{	
		popup = new OpenLayers.Popup.Anchored("search", 
                                new OpenLayers.LonLat(78.46881,11.46881),
                                  new OpenLayers.Size(200,125),
 	"Enter the Information:<br /><br \><div id=\"test\" class=\"pop\"
style='font-size:.8em'>District:&nbsp\;&nbsp\;<select id=dname><option
selected value=\"\">Select...</option><option value=cu>Cu</option><option
value=ma>Ma</option><option value=na>Na</option><option
value=si>Si</option><option value=th>Th</option><option
value=th>Thr</option></select><br><br><center><input type=button
value=\"OK\" onclick=\"update()\"> </center><br/>",null, true);      	
 	
popup.autoSize=true;
popup.setBackgroundColor("#23238E");
popup.setOpacity(0.9);
map.addPopup(popup); 
	       
}
	
Thanks in advance.

Cheers,
Reena.






Arnd Wippermann wrote:
> 
> Hi,
> 
> you can do it on server-side with templates or client-side with 
> javascript.
> 
> Server-side:
> Create html templates for your query:
> 
> A Header template with:
> <select>
> 
> A body template with:
> <option value="[item1]">[item2]
> 
> And a Footer template with:
> </select>
> 
> Then your query returns the HTML for a drop down box.
> 
> Client-side:
> Create a body template that returns a list of the results:
> [item1],[item2],[item3]
> 
> Then your query returns text, which you can transform with javascript 
> into the HTML for a drop down box.
> 
> Arnd Wippermann
> 
> -----Ursprüngliche Nachricht-----
> Von: users-bounces at openlayers.org 
> [mailto:users-bounces at openlayers.org] Im Auftrag von S.Reena
> Gesendet: Sonntag, 27. Juli 2008 11:37
> An: users at openlayers.org
> Betreff: [OpenLayers-Users] Include drop down box in popup that 
> contains query result
> 
> 
> I have made popup in UMN openlayers. I want to make a dynamic drop 
> down box in it that shows result of the  postresql database query. Can 
> any one guide me up as to what to use..Python or something else..
> 
> Cheers,
> Reena. 
> --
> View this message in context:
> http://www.nabble.com/Include-drop-down-box-in-popup-that-contains--qu
> ery-re
> sult-tp18674744p18674744.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

--
View this message in context:
http://www.nabble.com/Include-drop-down-box-in-popup-that-contains--query-re
sult-tp18674744p18681306.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list