[mapguide-users] Fusion Flyout problem (Mapguide Studio issue?)

David Hequet david.hequet at free.fr
Tue May 27 10:06:09 EDT 2008


Hi,

I noticed that creating Fusion template without a toolbar that include
Flyout or tweaking existing with Mapguide Studio can throw javascript error.
(tested with MapGuide Enterprise 2009 and MGOS 2.0)

IE: If you remove the FileMenu composant from an existing template (with
Studio) and render the layout in your browser, Fusion will try to render
sub-element from this toolbar (Map Menu and view Menu). 
Because of the container (toolbar) does not exist, when Fusion try to add
the Flyout it throw a javascript error.

As the flyout menu is saved in the repository's ApplicationDefinition you
can remove the flyout from the toolbar then remove the toolbar from the
template (then it will not try to render, so no error).

I tweaked the Fusion's applicationdefinition.js code so it don't try to
render menu if container doesn't exist.

If you have better idea tell me, if my code tweak seems self-sufisant put it
in the next release :)

Here is the code :

Fusion.Lib.ApplicationDefinition.Item = Class.create();
Fusion.Lib.ApplicationDefinition.Item.prototype = {
..................
            case 'Flyout':
                /* create a menu */

                var menu;
                var opt = {};
                opt.label = this.flyout.label;
                opt.tooltip = this.flyout.tooltip;
                opt.image = this.flyout.imageUrl;
                opt.imageClass = this.flyout.imageClass;
                if (container instanceof Jx.Toolbar) {
                    menu = new Jx.Menu(opt);
                } else if (container instanceof Jx.Menu ||
                           container instanceof Jx.ContextMenu ||
                           container instanceof Jx.SubMenu) {
                    menu = new Jx.SubMenu(opt);
                } else if (container == undefined) // if container does not
exist, does not create the menu
                {
                  break;
                }
                container.add(menu);
                this.flyout.create(widgetSet, menu);
                
                break;
.............
};

Regards,
David
-- 
View this message in context: http://www.nabble.com/Fusion-Flyout-problem-%28Mapguide-Studio-issue-%29-tp17491234p17491234.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list