[mapguide-users] NamedCollection reference

Alain Lebatard alain.lebatard at autodesk.com
Mon Nov 6 12:42:29 EST 2006


It's true that the selection model is different for each viewer, the
selection being evaluated - and stored - on the server side in the case
of the AJAX viewer. 

 

That said, the AJAX viewer also maintains information of the current
selection in the client, so with both viewers you can get the current
selection using the javascript function GetSelectionXML(), implemented
by mapFrame. Both viewers will return the same XML description of the
selection that you can send to your server-side script for processing
(using MgSelection). If your server-side script modifies the selection,
you can re-inject it in the client using the method SetSelectionXML(),
also implemented by mapFrame and supported by both viewers. In most
cases your server script will not have to care about the type of viewer,
unless it modifies the selection. In this case, when the request comes
from an AJAX viewer, you'll need to save the modified selection in your
session repository.

 

Alain

 

  _____  

From: Knight, Gregory [mailto:Gregory.Knight.bra at cityofboston.gov] 
Sent: Saturday, November 04, 2006 7:04 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] NamedCollection reference

 

I actually misspoke here...  DWF was implemented as a script and AJAX as
a URL.  

 

At the risk of being redundant, as I explained in my earlier post, I was
led to believe by the selection examples in Ch 3 of the Dev Guide that
due to the differences in which the viewers maintain selection
information, that a different approach was necessary in each case.  

 

If this is inaccurate, Id be interested in alternative approaches that
would be more consistent between the two viewers.

 

Thanks...

 

Greg

 

  _____  

From: Alain Lebatard [mailto:alain.lebatard at autodesk.com]
Sent: Fri 11/3/2006 5:09 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] NamedCollection reference

Hi Greg,

 

I don't think that will be easy...But before trying to explore such a
hack, I think it would be worth determining why your code has to be
implemented differently for the DWF and the AJAX viewer. What prevents
you to implement in the AJAX viewer your command as a URL as you do for
the DWF viewer?

 

Alain

 

  _____  

From: Knight, Gregory [mailto:Gregory.Knight.bra at cityofboston.gov] 
Sent: Friday, November 03, 2006 1:15 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] NamedCollection reference

 

I finally found the problem here.  Slight typo on my part <redface>.


I finally got the tool working as desired with both the ajax and dwf
viewers.<I feel like im having a conversation with myself here : ) >

 

Anyways, I do have a related question...  Due to the difference in which
the AJAX and DWF viewers deal with selections, I had to implement the
commands differently - AJAX as a Script and DWF as a URL.  I can hide
the DWF URL command from the AJAX viewer because Invoke URL action
supports this, but I cannot hide the AJAX SCRIPT command from the DWF
viewer as Invoke Script doesn't seem to support this.  

 

Is there some other way (programatically perhaps?) that I can hide a
Script command based on the client's viewer?

 

Greg

 

  _____  

From: Knight, Gregory 
Sent: Friday, November 03, 2006 10:12 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] NamedCollection reference

 

A little more info on my problem here:

 

I am working though the examples in ch 3 of the dev guide - working with
the active selection - for both the dwf and ajax viewers.  

 

I have 2 pages or functions - one for each viewer - and the code is the
same in both cases with the exception of the single line of code that
gets the selection from the map.  As the dev guide explains, this is due
to the different manner in which the dwf and ajax viewers deal with
selections.

 

So, my DWF example is working.  I can select a feature on my map, and
return feature data to my task pane.  My AJAX example isn't working, and
I still get the error below.

Seems rather odd, since the code is the same with the noted exception.

 

Any insight here?


Greg

 

 

  _____  

From: Knight, Gregory 
Sent: Thursday, November 02, 2006 4:52 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] NamedCollection reference

 

I am getting the following error when loading a mg page that retrieves
feature properties from a selected feature.

 

Duplicate object.Duplicate object. Exception occurred in method
CheckDuplicate at line 491 in file
c:\build_tux_area\mgdev_opensource\common\service\data\NamedCollection.c
pp  

 

How do I go about troubleshooting this?

 

Greg Knight

  _____  



The substance of this message, including any attachments, may be
confidential, legally
privileged and/or exempt from disclosure pursuant to Massachusetts
law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and
delete the material from any computer.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061106/0eb3e0d5/attachment.html


More information about the Mapguide-users mailing list