[FIXED] [2.3] Possible Bug in Resource Manager when Loading a Portal

  1. #1

    [FIXED] [2.3] Possible Bug in Resource Manager when Loading a Portal

    Hi Ext team,

    I've been working on an application using the Desktop as the main UI paradigm.

    A couple of days ago I faced an issue that might or might not be a bug, but I did some investigation and it seems to be bug, hence I'm reporting it here rather than in the community forums. If it's not, please feel free to remove/ignore this thread. I think it might have to do with the way the Resource Manager handles the creation/attachment of the Window definition to the Module when a Portal is included in the Window as opposed to when it doesn't include a Portal. Your input would be appreciated.

    How to Reproduce:
    The setup you can use to reproduce the problem is exactly the same as the one I showed in this thread.

    Issue Description
    When one of the dynamically loaded modules declares a window that contains a Portal, the window is not rendered properly when the shortcut is clicked, if the Portal panel definition is removed, then the window renders correctly.

    You could use the following code to generate the Portal module (try commenting the Portal definition to experience the difference/error in the Window rendering:
        public class DashboardViewModel : Window
        {
            public DashboardViewModel()
            {
                this.ID = "Dashboard_Window";
                this.Title = "Dashboard";
                this.Width = 800;
                this.Height = 600;
                this.Layout = LayoutType.Fit.ToString();
                this.CloseAction = CloseAction.Hide;
                this.Items.Add(CreatePortal());
            }
    
            private AbstractComponent CreatePortal()
            {
                Panel portal = new Panel()
                {
                    Items =
                    {
                        new Portal()
                        {
                            Items =
                            {
                                new PortalColumn()
                                {
                                    Title = "New Column",
                                    Width = 400,
                                    Items = 
                                    {
                                        new Portlet()
                                        {
                                            ID = "NewPortlet1",
                                            Title = "My new portlet"
                                        }
                                    }
                                }
                            }
                        }
                    }
                };
                return portal;
            }
    Investigation
    On further inspecting Ext's dynamically generated code, the only difference I can see is that when the Portal element is defined, the script to add the Window to the Module is wrapped inside a function and given to the "load" function of the Resource Manager. When a Module is defined with a Window that does not contain a Portal, it loads the window in a different manner, which doesn't involve the Resource Manager.
    I've provided examples of the generated JS in both cases below:

    When Module definition does not include a Portal (Window rendered correctly)
    App.Desktop.addModule(Ext.create("Ext.ux.desktop.Module", {
                id : "NoPortal",
                shortcut : {
                    name : "No Portal",
                    module : "NoPortal"
                }
            }));
        App.Desktop.getModule("NoPortal").addLauncher({
            xtype : "menuitem",
            text : "No Portal"
        });
    App.Desktop.getModule("NoPortal").addWindow(function () {
            Ext.net.ResourceMgr.destroyCmp("App.NoPortal_Window");
            App.TxMonitorDesktop.getModule("NoPortal").setWindow({
                id : "NoPortal_Window",
                autoRender : false,
                height : 600,
                hidden : false,
                width : 1400,
                xtype : "window",
                stateful : true,
                items : [{
                        id : "DetailsPanel",
                        border : false,
                        html : "<p>Some Content</p>",
                        region : "center",
                        layout : "fit"
                        }],
                layout : "border",
                title : "No Portal",
            });
        });
    When the Window includes a Portal (Window rendered as a small window with no title or any other content, also ClientID doesn't seem to be generated to the HTML
        App.Desktop.addModule(Ext.create("Ext.ux.desktop.Module", {
                id : "Dashboard",
                shortcut : {
                    "name" : "Dashboard",
                    "module" : "Dashboard"
                }
            }));
        App.Desktop.getModule("Dashboard").addLauncher({
            xtype : "menuitem",
            text : "Dashboard"
        });
        App.Desktop.getModule("Dashboard").addWindow(function () {
            Ext.net.ResourceMgr.load([{
                        url : "/ux/portal/portal-js/ext.axd?v=41185"
                    }, {
                        mode : "css",
                        url : "/ux/resources/portal-embedded-css/ext.axd?v=41185"
                    }
                ], function () {
                Ext.net.ResourceMgr.destroyCmp("App.Dashboard_Window");
                App.Desktop.getModule("Dashboard").setWindow({
                    id : "Dashboard_Window",
                    autoRender : false,
                    height : 600,
                    hidden : false,
                    width : 800,
                    xtype : "window",
                    items : [{
                            items : [{
                                    xtype : "portalpanel",
                                    items : [{
                                            width : 400,
                                            items : [{
                                                    id : "NewPortlet1",
                                                    title : "My new portlet"
                                                }
                                            ],
                                            title : "New Column"
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    layout : "fit",
                    title : "Dashboard"
                });
            });
        });
    Last edited by Daniil; Aug 10, 2013 at 8:19 AM. Reason: [FIXED] [2.3]
  2. #2
    Hi @AussieChuck,

    Yes, I think it is a bug. Thank you for the detailed report, really appreciated. Also sorry for the delay.

    We are investigating.
  3. #3
    Hi

    Thanks for your report, fixed in SVN
    Vladimir Shcheglov
    Sr. Developer
  4. #4
    Thanks. That's great. I'm glad I wasn't imagining things ... :)

Similar Threads

  1. [CLOSED] Ext.onReady and Resource Manager DocumentReady
    By Kev in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 27, 2013, 3:54 AM
  2. [CLOSED] What is the Resource Manager and how do I use it?
    By jwf in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 29, 2011, 6:46 PM
  3. Script Manager and Resource Manager Conflict
    By EugeneNiemand in forum 1.x Help
    Replies: 6
    Last Post: Jun 20, 2011, 7:34 AM
  4. Replies: 5
    Last Post: Oct 26, 2010, 2:20 PM
  5. Replies: 4
    Last Post: Sep 22, 2010, 7:43 AM

Tags for this Thread

Posting Permissions