[mapguide-users] getWidgetById() function returns a null value

Iulia Tamas iulia_tamas30 at yahoo.com
Wed Oct 12 11:23:13 EDT 2011


Hello,
I get a null value when i call Fusion.getWidgetById('Map')  
I have opend the map in an iframe called "fusionFrame" . This is how i call the getWidgetById function: 

                mgApiMapWidgetId='Map';
                var Fusion = window.top.fusionFrame.Fusion;
                var mapWidget = Fusion.getWidgetById(mgApiMapWidgetId);
                if (mapWidget != null && mapWidget.isMapLoaded()) {
                    alert(mapWidget.getMapName());
                }


Fusion.getWidgetById(mgApiMapWidgetId) always returns a null value in IE, but in Mozilla if I add an alert("") before calling the function, the mapWidget is not null anymore and  the map name is alerted
The code is runnig in a hidden iframe called 'scriptFr'
I'm using Mapguide 2.2

Does anybody know why this happens?

Thank you,
Iulia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20111012/a13d9a46/attachment.html


More information about the mapguide-users mailing list