<div dir="ltr"><div><div>that version of mapguide and fusion is ancient, can you upgrade?<br><br></div>the amount of bug fixes, performance improvement and improvements <br>since 2.2 are huge<br><br><br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 5:49 PM, Rodolfo Moreno <span dir="ltr"><<a href="mailto:rodolfoamoreno@gmail.com" target="_blank">rodolfoamoreno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi All,<br>
I want to add an event to fusion, exactly in the moment when the user turns<br>
on or off a layer.<br>
I saw the code sample in the COOKBOOK:<br>
<a href="http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events" target="_blank">http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events</a><br>
I followed all steps of the COOKBOOK however I get an error on the following<br>
line:<br>
<br>
stateChanged: function(obj, event) {<br>
        if (obj.legend && obj.legend.treeItem.checkBox) {<br>
            if (obj.legend.treeItem.checkBox.checked) {<br>
                *this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_ON, obj);*<br>
                obj.show();<br>
            } else {<br>
                this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_OFF, obj);<br>
                obj.hide();<br>
            }<br>
        }<br>
        OpenLayers.Event.stop(event, true);<br>
    },<br>
<br>
The message that I got is: "The object does not support this property or<br>
method"<br>
In the debug mode I saw that effectively *this* object does not have the<br>
triggerEvent method.<br>
I suppose that this error is due to the code sample from the cookbook is<br>
related with older fusion versions.<br>
<br>
I am using the fusion version that come with MapGuide OS 2.2<br>
I would appreciate so much for any suggestions. Thanks in advance.<br>
Rodolfo<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Adding-Events-In-Fusion-tp5091395.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Adding-Events-In-Fusion-tp5091395.html</a><br>
Sent from the Fusion Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
fusion-users mailing list<br>
<a href="mailto:fusion-users@lists.osgeo.org">fusion-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/fusion-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/fusion-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Zac Spitzer<br>+61 405 847 168<br><br></div>
</div>