Fusion Flyout problem (Mapguide Studio issue?)

2 messages Options
Embed this post
Permalink
David Hequet

Fusion Flyout problem (Mapguide Studio issue?)

Reply Threaded More More options
Print post
Permalink
Hi,

I move my message from the MapGuide mailing list:

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, don't know what version of Fusion is in).

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
Paul Spencer-2

Re: Fusion Flyout problem (Mapguide Studio issue?)

Reply Threaded More More options
Print post
Permalink
Hi David,

the fusion-users list only allows posts from members, but I've let  
this one through for now.  If you plan to post again, I would  
encourage you to subscribe.

This is a good catch, I have filed a ticket for this:

http://trac.osgeo.org/fusion/ticket/72

It will be reviewed to see if your change is sufficient - there may be  
other cases where a missing container could cause an exception.

Cheers

Paul

On 28-May-08, at 10:47 AM, David Hequet wrote:

>
> Hi,
>
> I move my message from the MapGuide mailing list:
>
> 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, don't know what  
> version
> of Fusion is in).
>
> 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-tp17514398p17514398.html
> Sent from the Fusion Users mailing list archive at Nabble.com.
>
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users