[mapguide-users] Dotnetviewersample - query: How to select multi-features?

jamesdudden jamesdudden at blueyonder.co.uk
Fri Nov 28 10:31:39 EST 2008


Hi,
In the dotnetviewersample query i am trying to crreate a multi-select option
from the results.

So far i have added code to loop through the results and put up an alert of
each ID. The loop also highlights the features one after the other but i
want to highlight them all at once. The file i am editing is querymain.aspx
- does anybody have any idea where to go next?

Any help or advice would be appreciated.

Regards
James

Snippet of code:

function SelectFeature()
        {
	var picked = ''; 
  	for (i=0; i<document.getElementById('resultSelect').options.length; i++)
{ 
    	if (document.getElementById('resultSelect').options[i].selected ==
true) { 
	picked += i+','; 
			
            var layerSelect = document.getElementById("layerSelect");
            var resultSelect = document.getElementById("resultSelect");
			
			
            reqParams = "COMMAND=<%=Command.GETSELECTIONXML%>";
            reqParams += "&SESSION=" + encodeURIComponent(session);
            reqParams += "&MAPNAME=" + encodeURIComponent(mapName);
            reqParams += "&LAYERNAME=" +
encodeURIComponent(layerSelect.value);
            reqParams += "&IDLIST=" + results[i].idList.toJSONString();
			
	var strOut = new String(results[i].idList.toJSONString()); 
    	strOut = strOut.replace(/[^0-9]/g, '');
	alert(strOut)
	
            if (msie)
                reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
            else
                reqHandler = new XMLHttpRequest();

            reqHandler.open("POST", "querycontroller.aspx", false);
			
            reqHandler.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
            reqHandler.send(reqParams);
            selectionXml = reqHandler.responseText;
            parent.parent.mapFrame.SetSelectionXML(selectionXml);
			
		} 
  	} 
  	document.getElementById('resultSelect').selectedIndex = -1;        
  	return picked; 
        }

-----
Straightforward solutions to take care of your business
http://www.software-matters.co.uk Software Matters 
-- 
View this message in context: http://www.nabble.com/Dotnetviewersample---query%3A-How-to-select-multi-features--tp20736413p20736413.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list