thanks for your reply but it's same in <a href="http://vb.net">vb.net</a> even i do count() it gives the same error<br><br>
<div class="gmail_quote">2009/5/26 Chris Claydon <span dir="ltr"><<a href="mailto:chris.claydon@autodesk.com">chris.claydon@autodesk.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I'm not too familiar with VB, but don't you need to call Layers.GetCount() (i.e. using brackets (), since it's a method)?<br>
<div>
<div></div>
<div class="h5"><br>-----Original Message-----<br>From: <a href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of <a href="mailto:wakrimsaloua.wakrim@gmail.com">wakrimsaloua.wakrim@gmail.com</a><br>
Sent: Tuesday, May 26, 2009 9:14 AM<br>To: <a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>Subject: [mapguide-users] prob with GetSelectionXml()<br><br>hi all! i've prob with use the xml selection wich i get after user clic on polygone, this is javascript function i use to get selection:(i write it in textfiel and read it by Request.Form:<br>
<br> function test()<br> {<br><br> k= document.formulaire.classe.value=carte.GetMapFrame().GetSelectionXML();<br><br><br> }<br><br>for get this selection i use this code<br><br> selectionXml = getValue("classe")<br>
<br><br> Private Function getValue(ByVal champ As String) As String<br> ' récupère la valeur du champ [champ] de la requête postée<br> ' qq chose ?<br> If Request.Form(champ) Is Nothing Then Return ""<br>
' on récupère la ou les valeurs du champ<br> Dim valeurs() As String = Request.Form.GetValues(champ)<br> Dim valeur As String = ""<br> Dim i As Integer<br> For i = 0 To valeurs.Length - 1<br>
valeur += valeurs(i)<br> Next<br> valeur = Server.UrlDecode(valeur)<br><br> Return valeur<br> End Function<br><br>after user clic on polygone and get xml selection , i use this code for filter and identify polygone ID:<br>
<br> Public Sub getselectionpartiel(ByVal map As MgMap, ByVal resourceService As MgResourceService, ByVal XmlSel As String)<br><br><br> Dim k = 0<br> If ((XmlSel <> Nothing) And (XmlSel <> "")) Then<br>
<br><br> Dim selection As New MgSelection(map, XmlSel)<br> Dim Layers As MgReadOnlyLayerCollection = selection.GetLayers()<br><br><br> If Not Layers.GetCount = 1 Then<br> Response.Write("More than one object was selected")<br>
<br> Exit Sub<br><br> End If<br><br><br><br><br><br><br> Response.Write("calques selectionnés")<br><br><br><br> End If<br><br> End Sub<br> and i call this function like that:<br>
getselectionpartiel(map, resourceSrvc, selectionXml)<br><br>it gives me this error:<br><br>"La référence d'objet n'est pas définie à une instance d'un objet." in the line:<br>(the object reference is not associated to the object instance)<br>
If Not Layers.GetCount = 1 Then<br><br>i think that Layers is empty but when i display "selectionXml" by using:<br><br>Response.Write(selectionXml) it gives me the correct selection!!!<br>if some one has some idea please tell it me, thanks a lot on advance<br>
<br><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br>