[mapguide-users] Autodesk Help - OnSelectionChanged

Walt Welton-Lair walt.welton-lair at autodesk.com
Wed May 17 00:02:34 EDT 2006


Thanks for posting these.
 
I debugged into this and the problem is with your watchInitialized()
method.  It only hooks up your custom OnSelectionChanged handler if
ViewerFrame.mapFrame.mapInit is true.  Unfortunately in the DWF Viewer
case, the mapFrame doesn't have a 'mapInit' variable.
 
The timer approach seems a bit complex.  I replaced it by setting an
onLoad handler on the ViewerFrame:
 
    <frame src="...." name="ViewerFrame" onLoad="doOnLoad();">
 
and then hooked up the custom SelectionChanged handler in doOnLoad():
 
    function doOnLoad()
    {
        originalOnSelectionChanged = ViewerFrame.OnSelectionChanged; 
        ViewerFrame.OnSelectionChanged = MyOnSelectionChangedHandler; 
    }
 
This works for both DWF and AJAX in IE.
 
Walt

  _____  

From: Jason Birch [mailto:Jason.Birch at nanaimo.ca] 
Sent: Monday, May 15, 2006 12:43 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Autodesk Help - OnSelectionChanged


I've put the source listings here:
 
This one works for me:
http://earth.nanaimo.ca/outbound/test_ajax.php.txt
<BLOCKED::http://earth.nanaimo.ca/outbound/test_ajax.php.txt> 
 
This one, with the only change being in the application the frameset
calls, does not:
http://earth.nanaimo.ca/outbound/test_dwf.php.txt
 
I'm wondering if the timer is somehow getting invalidated when I have to
activate the ActiveX control (by clicking on it or hitting space).
 
Jason

  _____  

From: Walt Welton-Lair [mailto:walt.welton-lair at autodesk.com] 
Sent: Friday, May 12, 2006 07:59
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Autodesk Help - OnSelectionChanged


I spent some time investigating this to see if I could reproduce what
you were seeing (the selection event working for AJAX but not for DWF).
 
I first tried it with the latest code (in the OSGEO vault), and the
mainframe's OnSelectionChanged handler was getting called for me when
using DWF Viewer.  I then reverted to the MGO 1.0 code, and it still
worked.  Finally I tried RC1, and it also worked.
 
For the tests above I was using a pre-release build of DWF Viewer 7
(which addresses the ActiveX activation issue).  Thinking that could be
a factor, I reverted to DWF Viewer 6.5.  Once again it was working in
all cases (latest code, 1.0, RC1).
 
For my test all I did was add some alerts statements to the
OnSelectionChanged handlers and verified these were popping up.
 
I'm not sure why you guys are having problems with this.  I covered all
the cases I could think of and didn't have any problems.
 
Note that adding code to the mainframe's OnSelectionChanged handler is
correct, since this handler is common to both AJAX / DWF.
 
BTW, if you do get it to work you'll find there's a bug with the current
DWF Viewer's OnSelectionChanged event: the event gets raised every time
you click in the map (the selection object stored by the viewer is
getting replaced, but no check is done to see if the set's contents are
actually different).  This is fixed in DWF Viewer 7.
 
Walt

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060517/63acc826/attachment.html


More information about the Mapguide-users mailing list