[CLOSED] Script Error using open a page in Tab Panel

Page 2 of 3 FirstFirst 123 LastLast
  1. #11
    Quote Originally Posted by Daniil View Post
    The NavigateGridPage method. This is called:
    Tab1.LoadContent();
    when no Url is specified for the Tab1's Loader.
    Hi,

    I have specified the url and also used Tab1.LoadContent().
    Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
    
     try
            {
                Tab1.Loader.LoadMask.ShowMask = true;
                Tab1.Loader.LoadMask.Msg = "Loading";
                Tab1.LoadContent();
            }
            catch (Exception ex)
            {
    
            }
  2. #12
    This is not executed for me when I debug your test case.
    Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
    Is it executed for you?
  3. #13
    Quote Originally Posted by Daniil View Post
    This is not executed for me when I debug your test case.
    Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
    Is it executed for you?
    Hi,

    I think you were executed Portalsub.aspx page only. This page is child page of Portal.aspx. Please see the sample already i provided.
  4. #14
    Quote Originally Posted by speedstepmem4 View Post
    I think you were executed Portalsub.aspx page only. This page is child page of Portal.aspx. Please see the sample already i provided.
    Seems I don't understand. Please elaborate.
  5. #15
    Quote Originally Posted by Daniil View Post
    Seems I don't understand. Please elaborate.
    In our application, I have a page(Portal.aspx). This sample source i have provided for the following section http://forums.ext.net/showthread.php...l=1#post119535.

    This page (Portal.aspx) contains one page (PortalSub.aspx).This sample source i have provided for following section http://forums.ext.net/showthread.php...l=1#post119636.

    ActiveTab.aspx is the child page which is loaded when click on the tab. This is the actual process we are used.

    Actually our start up page is "Portal.aspx"
  6. #16
    Ok, please post all the required things to reproduce the issue in the single post. Please simplify the code as much as you can.
  7. #17
    Quote Originally Posted by Daniil View Post
    Ok, please post all the required things to reproduce the issue in the single post. Please simplify the code as much as you can.
    Please create page names what i specified.

    1. Portal.aspx
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.ScriptManager1.AddScript("CallPage('1',document.getElementById('href_one'));");
            }
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
        </ext:ResourceManager>
        <ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
            Layout="FitLayout">
            <Content>
                <ext:Container ID="Container1" runat="server" Layout="BorderLayout">
                    <Items>
                        <ext:Panel ID="pnlNorth" runat="server" Height="75" Border="false" Header="false"
                            BodyStyle="background-color: transparent;" Region="North">
                            <Content>
                                North section
                            </Content>
                        </ext:Panel>
                        <ext:Panel runat="server" Width="165" ID="pnlSettings" BodyStyle="background-color: #284051;"
                            Region="West">
                            <Content>
                                <ext:Container ID="Container2" runat="server" Layout="AccordionLayout">
                                    <Items>
                                        <ext:Panel ID="Panel1" runat="server" Border="false" Collapsed="True" AutoScroll="true"
                                            BodyStyle="padding:6px;">
                                            <Content>
                                                <div class="link_west">
                                                    <ul>
                                                        <li id="menu_dash" runat="server"><a href="#" id="href_one" runat="server" onclick="CallPage('1',this);">
                                                            <asp:Literal ID="lbl_dash" runat="server" Text="Dashboard"></asp:Literal></a></li>
                                                    </ul>
                                                </div>
                                            </Content>
                                        </ext:Panel>
                                    </Items>
                                </ext:Container>
                            </Content>
                        </ext:Panel>
                        <ext:TabPanel ID="tpPortal" runat="server" Border="false" BodyStyle="background-color: transparent;"
                            Region="Center">
                            <Items>
                            </Items>
                            <Listeners>
                                <BeforeTabClose Fn="BeforeCloseTab" />
                            </Listeners>
                        </ext:TabPanel>
                    </Items>
                </ext:Container>
            </Content>
        </ext:Viewport>
        </form>
        <script type="text/javascript">
            var subPortalUrl = "PortalSub.aspx?module={0}";
    
            function BeforeCloseTab(t) {
                var tp = Ext.getCmp('tpPortal');
                if (tp.items.length == 1)
                    return false;
                else {
                    return true;
                }
            }
    
            function CallPage(val, anchorObj) {
                ActiveTabValue = val;
                var modulename = "";
                if (anchorObj != null)
                    modulename = anchorObj.innerHTML;
                if (modulename != "")
                    DimensionPortal.addTab({ title: modulename, url: Ext.String.format(subPortalUrl, val), id: val });
            }
    
            var DimensionPortal = {
                hashCode: function (str) {
                    var hash = 1315423911;
    
                    for (var i = 0; i < str.length; i++) {
                        hash ^= ((hash << 5) + str.charCodeAt(i) + (hash >> 2));
                    }
    
                    return (hash & 0x7FFFFFFF);
                },
    
                addTab: function (config) {
                    if (Ext.isEmpty(config.url, false)) {
                        return;
                    }
                    var tp = Ext.getCmp('tpPortal');
                    var sid = 'id_' + this.hashCode(config.url);
                    var tab = tp.getComponent(sid);
                    if (!tab) {
                        tab = tp.addTab({
                            id: sid,
                            title: config.title,
                            closable: true,
                            loader: {
                                loadMask: {
                                    showMask: true,
                                    msg: "Loading " + config.title
                                },
                                url: config.url,
                                renderer: 'frame',
                                autoLoad: true
                            },
                            listeners: {
                                beforeShow: {
                                    fn: function (item, trigger, index, tag, e) {
    
                                    }
                                }
                            }
                        });
    
                    } else {
                        tp.setActiveTab(tab);
                        Ext.get(tab.tabEl).frame();
                    }
                }
            };
    
    
            var isTabDisabled = false;
            function EnableTabs() {
    
                if (isTabDisabled) {
                    var tOutEnableTabs = setTimeout(function () {
    
                        var tab1 = GetActiveTabExtObj('Tab1');
                        var tab2 = GetActiveTabExtObj('Tab2');
                        var tab3 = GetActiveTabExtObj('Tab3');
                        var tab4 = GetActiveTabExtObj('Tab4');
                        var tab5 = GetActiveTabExtObj('Tab5');
    
                        tab1.setDisabled(false);
                        tab2.setDisabled(false);
                        tab3.setDisabled(false);
                        tab4.setDisabled(false);
                        tab5.setDisabled(false);
                        isTabDisabled = false;
                        clearTimeout(tOutEnableTabs);
                    }, 300);
                }
            }
        </script>
    </body>
    </html>
    2. PortalSub.aspx
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["module"] != null)
                H_Txt1.Text = Request.QueryString["module"].ToString();
            if (!IsPostBack)
                NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
        }
    
        protected void GridNavigateProcess(object sender, DirectEventArgs e)
        {
            NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
            ScriptManager1.AddScript("top.EnableTabs();");
        }
    
        protected void NavigateProcess(object sender, DirectEventArgs e)
        {
            NavigatePage(TabPanel1.ActiveTabIndex, ref Tab2);
    
            ScriptManager1.AddScript("top.EnableTabs();");
    
        }
    
    
        private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
        {
            TabPanel1.ActiveTabIndex = 2;
            CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
            CurrentTab.Loader.LoadMask.ShowMask = true;
            CurrentTab.Loader.LoadMask.Msg = "Loading";
            CurrentTab.LoadContent();
        }
    
        private void NavigateGridPage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
        {
            string headText = string.Empty;
            string preLoad = string.Empty;
            switch (H_Txt1.Text)
            {
    
                case "1":
                    if (preLoad != "DashBoard")
                    {
                        TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");
    
                        Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
                        Tab1.Title = "News";
    
                        Tab2.Enabled = true;
                        Tab2.Title = "Open Workflow";
    
    
                        ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(true);");
                        ScriptManager1.AddScript("Ext.getCmp('" + Tab2.ClientID + "').enable();");
                        TabPanel1.ActiveTabIndex = 0;
                        preLoad = "Dashboard";
                    }
                    break;
    
            }
            try
            {
                Tab1.Loader.LoadMask.ShowMask = true;
                Tab1.Loader.LoadMask.Msg = "Loading";
                Tab1.LoadContent();
            }
            catch (Exception ex)
            {
    
            }
        }
       
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
        </ext:ResourceManager>
        <ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
            Layout="FitLayout">
            <Content>
                <ext:Container ID="Container1" runat="server" Layout="BorderLayout">
                    <Content>
                        <ext:TabPanel ID="TabPanel1" runat="server" AutoScroll="false" BodyStyle="background-color: #427298;"
                            TabPosition="top" Region="Center">
                            <Items>
                                <ext:Panel ID="Tab1" runat="server">
                                    <Loader ID="loader1" runat="server" Mode="Frame" AutoLoad="false">
                                    </Loader>
                                    <DirectEvents>
                                        <Activate OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="120000"
                                            Success="CEvent();">
                                        </Activate>
                                    </DirectEvents>
                                </ext:Panel>
                                <ext:Panel ID="Tab2" runat="server" BodyStyle="background:white">
                                    <Loader ID="loader2" runat="server" Mode="Frame" AutoLoad="false">
                                    </Loader>
                                    <DirectEvents>
                                        <Activate OnEvent="NavigateProcess" ShowWarningOnFailure="false" Timeout="120000">
                                        </Activate>
                                    </DirectEvents>
                                </ext:Panel>
                            </Items>
                        </ext:TabPanel>
                    </Content>
                </ext:Container>
            </Content>
        </ext:Viewport>
        <ext:TextField ID="H_Txt1" runat="server" Hidden="true">
        </ext:TextField>
        <ext:Button ID="Button1" runat="server" AutoPostBack="false" IconCls="ok" Hidden="true">
            <DirectEvents>
                <Click Delay="1" OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="1200000">
                </Click>
            </DirectEvents>
        </ext:Button>
        </form>
        <script type="text/javascript">
    
    
            function CEvent() {
    
                if (document.getElementById('Tab1_IFrame') != null) {
                    if (document.getElementById('Tab1_IFrame').contentWindow != null) {
                        if (document.getElementById('Tab1_IFrame').contentWindow.Button1 != null)
                            document.getElementById('Tab1_IFrame').contentWindow.Button1.fireEvent("click");
                    }
    
                }
            }
    
        </script>
    </body>
    </html>
    3.ActiveTab.aspx
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write("Page Loaded in Tab " + Request.QueryString["tabid"].ToString());
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
        </ext:ResourceManager>
        </form>
    </body>
    </html>
  8. #18
    Please try the following:
    Tab1.Loader.SuspendScripting();
    Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
    Tab1.Loader.ResumeScripting();
  9. #19
    Quote Originally Posted by Daniil View Post
    Please try the following:
    Tab1.Loader.SuspendScripting();
    Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
    Tab1.Loader.ResumeScripting();
    I changed the following in PortalSub.aspx page, still same issues occured like this SCRIPT5009: 'loader1' is undefined ->SCRIPT257: Could not complete the operation due to error 80020101.
    ->

    Daniil, did you check for this changes in your testing area?

    case "1":
                    if (preLoad != "DashBoard")
                    {
                        TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");
                        Tab1.SuspendScripting();
                        Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
                        Tab1.ResumeScripting();
                        Tab1.Title = "News";
    
                        Tab2.Enabled = true;
                        Tab2.Title = "Open Workflow";
    
    
                        ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(true);");
                        ScriptManager1.AddScript("Ext.getCmp('" + Tab2.ClientID + "').enable();");
                        TabPanel1.ActiveTabIndex = 0;
                        preLoad = "Dashboard";
                    }
                    break;
    private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
        {
            TabPanel1.ActiveTabIndex = 2;
            CurrentTab.SuspendScripting();
            CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
            CurrentTab.ResumeScripting();
            CurrentTab.Loader.LoadMask.ShowMask = true;
            CurrentTab.Loader.LoadMask.Msg = "Loading";
            CurrentTab.LoadContent();
        }
  10. #20
    This
    Tab1.SuspendScripting();
    doesn't match
    Tab1.Loader.SuspendScripting();
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [CLOSED] Script Error using open Popup page
    By speedstepmem4 in forum 2.x Premium Help
    Replies: 11
    Last Post: Oct 07, 2013, 2:23 PM
  2. Replies: 7
    Last Post: Jun 12, 2013, 2:05 PM
  3. Replies: 3
    Last Post: Feb 26, 2013, 3:45 PM
  4. Replies: 2
    Last Post: Jul 29, 2009, 2:57 PM
  5. AutoLoad Panel Populate Child Page Error
    By camus92 in forum 1.x Help
    Replies: 5
    Last Post: Mar 09, 2009, 5:08 PM

Tags for this Thread

Posting Permissions