[mapguide-users] RE: Working with the current selection
Alain Lebatard
alain.lebatard at autodesk.com
Wed Apr 26 13:39:43 EDT 2006
$CurrentSelection is what you specify in Studio's web layout editor to
indicate that this command should send the current selection to the
server. When you create an Invoke URL command in Studio, look in the
"Additional parameters" tab, in the list "Pass in these additional
parameters to the URL". There you specify as "Key" the name of the
parameter you want for the selection, and as "Value" the macro
$CurrentSelection.
The viewer code will replace this macro with the actual value of the
selection at run-time, when the command is executed. The Asp.net script
will receive the XML description of the selection in the parameter you
specified in Studio. From there you can use an MgSelection object that
you can initialize either with the MgSelection constructor or the method
FromXml.
-----Original Message-----
From: Berdel, Brian [mailto:brian.berdel at mcmtrans.com]
Sent: Wednesday, April 26, 2006 10:27 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: Working with the current selection
Thanks for the response, but how would I reference the $CurrentSelection
parameter in asp.net?
-----Original Message-----
From: Alain Lebatard [mailto:alain.lebatard at autodesk.com]
Sent: Wednesday, April 26, 2006 1:02 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] RE: Working with the current selection
The way to make it work for both the AJAX viewer and the DWF viewer is
to have the client send the current selection to your server-side
script, instead of having the server script trying to get the selection
from the session repository.
If your script is invoked from a web layout command 'Invoke URL', have
the current selection sent to the script by adding in Studio the
parameter $CurrentSelection to the command. If your script is invoked by
custom Javascript code, have this code retrieve the current selection
with GetSelectionXML() and add a parameter to your URL to send this
selection to the server. In this case be careful to use a POST request
and not a GET, as the size of the selection might exceed the maximum
length supported for a GET request (usually about 1K). Look at the
Submit() method in FormFrame, which makes it easy to do a POST request.
Alain
-----Original Message-----
From: kalpesh [mailto:kalpesh at pie-solution.com]
Sent: Tuesday, April 25, 2006 9:50 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] RE: Working with the current selection
But what if we want to make it work in DWF Viewer. Is there any
workaround ?
Kalpesh
--
View this message in context:
http://www.nabble.com/RE%3A-Working-with-the-current-selection-t1468388.
html#a4094930
Sent from the OSGeo MapGuide forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org
More information about the Mapguide-users
mailing list