[CLOSED] Loader with Html renderer and Window rendering

Page 3 of 4 FirstFirst 1234 LastLast
  1. #21
    I have tried to make Chrome shapshots for this simple page.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void RenderWindow(object sender, DirectEventArgs e)
        {
            Window win = new Window();
            win.Html = "Close me";
            win.CloseAction = CloseAction.Destroy;
            this.Form.Controls.Add(win);
            win.Render();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button runat="server" Text="Render Window" OnDirectClick="RenderWindow" />
        </form>
    </body>
    </html>
    I had the following results:

    1. Initially just after page load.
    6.62MB

    2. Render the Window
    7.03MB

    3. Close the Window.
    7.01MB

    4. Render the Window.
    7.11MB

    5. Close the Window.
    7.15MB

    6. Render the Window
    7.19MB

    7. Close the Window.
    7.15MB


    Generally, the same as you had with your application.

    I'm not sure how to handle these results, but there should not be any memory leaking in this simple example.
  2. #22
    I think the thread appears to be related to this one.
    http://forums.ext.net/showthread.php?18515

    Also you can be interested to look at this thread.
    http://forums.ext.net/showthread.php?19142
  3. #23
    Hello,

    when my windows opens, an undesired query string parameters appears in the url:

    &_dc=1371645351581&

    this causes an error to destination page.
    How can I prevent this behaviour?
    Thanks in advance
    Marco

    .cs page
                    Window win = new Window
                    {
                        ID = "Window1",
                        Title = "Contratto",
                        Width = Unit.Pixel(1000),
                        Height = Unit.Pixel(600),
                        Collapsible = true,
                        Maximizable = true,
                        Modal = true,
                        CloseAction = CloseAction.Destroy,                                       
                        // Html = "A new Window  was created at: " + DateTime.Now.ToLongTimeString(),
                        Loader = new ComponentLoader
                        {
                              Url = "http://pom-sql01/ReportServer/Pages/ReportViewer.aspx?%2fAGS_MSCRM%2fTicket+AGS+in+WORD&rs%3aCommand=Render&rs:Format=PDF&CRM_IncidentId={0}" + Idticket;
                            Mode = LoadMode.Frame,
                            LoadMask =
                            {
                                ShowMask = true,
                                Msg = "Caricamento in corso..."
                            }
                        }
                    };
    
                    win.Render(this.Form);
  4. #24
    Hi Marco,

    Please provide a full test case.
  5. #25
    Hi Daniil,
    you can see it in "Load External Website" example at

    https://examples2.ext.net/Examples/W...ernal_Website/

    If you insepect the http traffic, yo can see that external page is called with the following url:

    http://www.ext.net/?_dc=1371730805190&

    This causes a problem with my destination page.
    Marco
  6. #26
    It is a cache buster parameter. To disable it, please set DisableCaching="false" for a Loader instance.

    Currently, there will be "/?" at the end. If it still breaks because of this "/?", please update from SVN or add this fix to the page's <head>.

    Fix to remove "/?"
    Ext.net.ComponentLoader.override({
        loadFrame: function (options) {
            options = Ext.apply({}, options);
    
            var me = this,
                target = me.target,
                mask = Ext.isDefined(options.loadMask) ? options.loadMask : me.loadMask,
                monitorComplete = Ext.isDefined(options.monitorComplete) ? options.monitorComplete : me.monitorComplete,
                disableCaching = Ext.isDefined(options.disableCaching) ? options.disableCaching : me.disableCaching,
                disableCachingParam = options.disableCachingParam || "_dc",
                params = Ext.apply({}, options.params),
                callback = options.callback || me.callback,
                scope = options.scope || me.scope || me;
    
            Ext.applyIf(params, me.params);
            Ext.apply(params, me.baseParams);
    
            Ext.applyIf(options, {
                url: me.url
            });
    
            Ext.apply(options, {
                mask: mask,
                monitorComplete: monitorComplete,
                disableCaching: disableCaching,
                params: params,
                callback: callback,
                scope: scope
            });
    
            this.lastOptions = options;
    
            if (!options.url) {
                throw 'No URL specified';
            }
    
            if (me.fireEvent('beforeload', me, options) === false) {
                return;
            }
    
            var url = options.url;
    
            if (disableCaching !== false) {
                url = url + ((url.indexOf("?") > -1) ? "&" : "?") + disableCachingParam + "=" + new Date().getTime();
            }
    
            if (!Ext.Object.isEmpty(params)) {
                var p = {};
                for (var key in params) {
                    var ov = params[key];
    
                    if (typeof ov == "function") {
                        p[key] = ov.call(target);
                    } else {
                        p[key] = ov;
                    }
                }
    
                p = Ext.urlEncode(p);
                url = url + ((url.indexOf("?") > -1) ? "&" : "?") + p;
            }
    
            if (mask) {
                me.addMask(mask);
            }
    
            if (Ext.isEmpty(target.iframe)) {
                var iframeObj = {
                    tag: "iframe",
                    id: target.id + "_IFrame",
                    name: target.id + "_IFrame",
                    src: url,
                    frameborder: 0
                },
                layout = target.getLayout();
    
                if (!target.layout || target.layout.type !== "fit") {
                    target.setLayout(Ext.layout.Layout.create("fit"));
                }
    
                target.removeAll(true);
    
                var p = target,
                    iframeCt = {
                        xtype : "component",
                        autoEl: iframeObj,
                        listeners: {
                            afterrender: function () {
                                var owner = this.ownerCt;
                                owner.iframe = this.el;
    
                                if (monitorComplete) {
                                    owner.getLoader().startIframeMonitoring();
                                } else {
                                    this.el.on("load", owner.getLoader().afterIFrameLoad, owner.getLoader());
                                }
    
                                owner.getLoader().beforeIFrameLoad(options);
                            }
                        }
                    };
    
                target.add(iframeCt);
            } else {
                target.iframe.dom.src = Ext.String.format("java{0}", "script:false");
    
                try {
                    window.frames[target.iframe.dom.name].location.replace(url);
                } catch (e) {
                    target.iframe.dom.src = url;  // IE9 refresh iframe with pdf issue: http://forums.ext.net/showthread.php?24690
                }
    
                this.beforeIFrameLoad(options);
            }
    
            if (!this.destroyIframeOnUnload) {
                this.destroyIframeOnUnload = true;
            }
        }    
    });
  7. #27
    It seems that a "&" is added instead of "/?". This is still a problem form me.

    I tried to putyour function on the page page this doesn't solve.

    Now, I am trying to update from svn.

    M
  8. #28
    Quote Originally Posted by marco.morreale View Post
    It seems that a "&" is added instead of "/?".
    I cannot reproduce it with the test case. If you still can reproduce it after updating from SVN trunk, please provide a test case.
  9. #29
    Ok Daiil,
    I try.

    The error I am getting is:

    Uncaught TypeError: Object #<Object> has no method 'isEmpty'
  10. #30
    Did you update from this location?
    http://svn.ext.net/premium/trunk
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [CLOSED] ext:Window Loader Autosize
    By supera in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Sep 05, 2016, 7:07 PM
  2. Replies: 5
    Last Post: May 18, 2012, 1:41 PM
  3. [CLOSED] Rendering html in a user control
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 14, 2012, 7:42 PM
  4. [CLOSED] Getting the parameter defined in ext:Window Loader
    By supera in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 17, 2012, 1:27 PM
  5. Replies: 1
    Last Post: May 28, 2010, 1:13 PM

Tags for this Thread

Posting Permissions