[CLOSED] IE9 and Button Listener problem - "Ext is undefined"

  1. #1

    [CLOSED] IE9 and Button Listener problem - "Ext is undefined"

    Hi people, im having a problem with a listener in IE9, here is its detail...

    * I have page A and page B.
    * Page B is opened in a window Page A has. The window is called "windowPopUp".
    * Page B has a javascript function that closes its parent's "windowPopUp". This function is called "closePage()".
    * Page B also has 2 buttons:
    - The first one works with the OnClientClick() event and calls the "closePage()" function. This one, works fine.
    - The second one works with a listener and calls the "closePage()" function. This one gives me an "Ext is undefined" exception.

    Im posting images and the code of each page.
    The listener works fine in Firefox 4, IE8 and IE9 Compat.View

    Thanks in advence.


    Pic of error.
    Click image for larger version. 

Name:	ExtNotDefined.jpg 
Views:	167 
Size:	105.0 KB 
ID:	2653

    Page A Code
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    
        <script runat="server">
    
            private Ext.Net.Window _popup;
            public Ext.Net.Window popup
            {
                get
                {
                    if (_popup == null)
                    {
                        _popup = new Ext.Net.Window { ID = "windowPopup" };
                        Controls.Add(_popup);
                    }
                    return _popup;
                }
                set { _popup = value; }
            }
    
            protected void Page_Load(object sender, EventArgs e)
            {
                // Doing this to make the popup usable
                this.LoadPopUp();
            }
    
            private void LoadPopUp()
            {
                this.popup.AutoShow = false;
                this.popup.Collapsible = false;
                this.popup.Resizable = false;
                this.popup.Draggable = false;
                this.popup.Closable = false;
                this.popup.Modal = true;
                this.popup.Height = 355;
                this.popup.Width = 640;
                this.popup.CloseAction = Ext.Net.CloseAction.Close;
                this.popup.Hide();
            }
    
            [DirectMethod]
            public void LoadNewPage()
            {
                this.popup.LoadContent(new Ext.Net.LoadConfig("PageB.aspx", Ext.Net.LoadMode.IFrame, true));
                this.popup.Show();
            }
        </script>
    
    </head>
    <body>
        <form id="form1" runat="server">
        
        <ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
        
        <ext:ViewPort ID="ViewPort1" runat="server" Layout="Fit" MonitorResize="true">
            <Items>
                <ext:Panel ID="pnlPrincipal" ButtonAlign="Center" AutoScroll="true" Width="1260" Frame="true" runat="server">
                    <Items>
                        
                    </Items>
                    <Buttons>
                        <ext:Button ID="btnLoadPage" runat="server" Width="70" IconAlign="left" Text="Nueva"
                            Icon="Add">
                            <Listeners>
                                <Click Handler="Ext.net.DirectMethods.LoadNewPage()" />
                            </Listeners>
                        </ext:Button>
                    </Buttons>
                </ext:Panel>
            </Items>
            
        </ext:ViewPort>
        
        </form>
    </body>
    </html>
    Page B Code
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
        </script>
    
        <script language="javascript" type="text/javascript">
            function closePage() {
                window.parent.windowPopup.hide();
                window.parent.windowPopup.clearContent();
            }
        </script>
        
    </head>
    <body>
        <form id="form1" runat="server">
    
            <ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
    
            <ext:ViewPort ID="ViewPort1" runat="server" Layout="Fit" MonitorResize="true">
                <Items>
                    <ext:Panel ID="pnlPrincipal" Icon="User" ButtonAlign="Center" AutoScroll="true" Width="1260" Frame="true" runat="server">
                        <Items>
                        </Items>
                        <Buttons>
                            <ext:Button ID="btnClose" Icon="Cross" Width="70" runat="server" OnClientClick="closePage();" Text="Close using OnClient Click"/>
                        
                            <ext:Button ID="btnClose2" Icon="Cross" Width="70" runat="server" Text="Close using Listener">
                                <Listeners>
                                    <Click Handler="closePage()" />
                                </Listeners>
                            </ext:Button>
                        </Buttons>
                    </ext:Panel>
                </Items>
            </ext:ViewPort>
        
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 29, 2011 at 5:09 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set Delay="1" for the Click listener.
    <Click Handler="closePage()" Delay="1" />
    .clearContent() destroys the content iframe, and it destroys the Ext object also. But ExtJS executes some code (with Ext object also) after that moment when the listener is executed, but the Ext object is already destroyed.

    I guess this works in IE lower than because IE9 is faster, so the Ext object is destroyed faster than in the previous IE.
  3. #3
    Worked in IE9 Daniil, thanks!

    I dont know why microsoft keeps with the idea of making a "web browser" ... i think that more than the 50%/70% of my development time is to make my site work with this (F word) IE.

    Thanks again.
  4. #4
    Oh, yes, it often takes off a lot of time :)
  5. #5

    I put the Delay="1" but did not work. But i am getting same error in only IE 9

    Quote Originally Posted by Daniil View Post
    Oh, yes, it often takes off a lot of time :)
    Please help me
    I used below code in button listener

    <ext:LinkButton ID="lnkSignout" runat="server" Cls="whitecls" Text="Sign out">
    <Listeners>
    <Click Delay="1" Handler=" Ext.net.Mask.show({msg:'Signing out...'});
    Ext.net.DirectMethods.lnkSignoutClick({
    success: function(result) {
    parent.TabPanel1.closeTab(parent.TabPanel1.getActi veTab());
    Ext.net.Mask.hide();------This line i am getting error
    }
    });
    " />
    </Listeners>
    </ext:LinkButton>

    But I am getting error Ext is undefined in only IE 9.
  6. #6
    Please wrap the code in special code tags.

    Also, as far as I can see, the problem is not related to the initial thread's topic. So, please start a new forum thread.

Similar Threads

  1. [CLOSED] SelectBox: Problem with characters "<" and ">"
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 03, 2011, 6:43 AM
  2. Replies: 4
    Last Post: Apr 29, 2011, 6:49 PM
  3. Replies: 9
    Last Post: Apr 25, 2011, 8:23 PM
  4. Replies: 12
    Last Post: Apr 13, 2011, 3:28 PM
  5. Replies: 14
    Last Post: Apr 12, 2011, 2:49 PM

Tags for this Thread

Posting Permissions