Microsoft JScript runtime error

  1. #1

    Microsoft JScript runtime error

    Hi,

    i have copied code from Adding Tab(Coolite Toolkit Examples),
    whenever i run my project i'm getting Microsoft JScript runtime error:'TabPanelCenter.menu.items' is null or not an object,

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuMaster.aspx.cs" Inherits="ApmcClient.MenuMaster" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!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 id="Head1" runat="server">
    
     <script type="text/javascript">
            function addTab1(tabPanel, id, url,displaytitle) 
            {
                var tab = tabPanel.getComponent(id);
              
                if (!tab) 
                {
                    tab = tabPanel.add({ 
                        id: id, 
                        title: displaytitle, 
                        closable:true,                    
                        autoLoad: {
                            showMask: true,
                            url: url,
                            mode:'iframe',
                            maskMsg: 'Loading' + url + '...'
                        }                    
                    });
    
                    tab.on('activate', function() 
                    {
                    
                        var item = TabPanelCenter.menu.items.get(id + "_item");
                       
                        if (item) {
                            TabPanelCenter.setSelection(item);
                        }
    
                    }, this);
                }
                tabPanel.setActiveTab(tab);
            }
        </script>
    </head>
    
    <body>
        <form id="form1" runat="server">
        
            <ext:ScriptManager ID="ScriptManager1" InitScriptMode="Inline" CleanResourceUrl="false"
                runat="server" />
            <ext:ViewPort ID="ViewPort1" runat="server">
                <Body>
                    <ext:BorderLayout ID="BorderLayout1" runat="server">
    
    <Center Margins-Left="0">
                <ext:Panel ID="Panel11" runat="server">
                 <Body>
                   <ext:FitLayout ID="FitLayout4" runat="server">
                   
                     <ext:TabPanel ID="TabPanelCenter" runat="server" ActiveTabIndex="0" Border="false" Title="Center" EnableTabScroll="true">
                      <Tabs>
                        <ext:Tab ID="Tab1" runat="server" Closable="false" Title="Home">
                          <Body>
                           <ext:FitLayout ID="FitLayout3" runat="server">
                                
                   <ext:Portal ID="Portal1" runat="server" Border="false">
                    <Body>
                      <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                        <ext:LayoutColumn ColumnWidth=".33">
                           <ext:PortalColumn 
                             ID="PortalColumn1" 
                             runat="server" 
                             StyleSpec="padding:10px 0 10px 10px" >
                              <Body>
                              
                        <ext:AnchorLayout ID="AnchorLayout1" runat="server">
                         <ext:Anchor>
                           <ext:Portlet ID="Portlet1" runat="server" Title="License Holder" Height="190" Frame="true">
                             <Body>
                              <table>
                                <tr class="RowsHeight">
                                 <td>
                                   <ext:Label ID="lblTrader" runat="server" Text="Traders=" />
                                 </td>
                                 
                                 <td>
                                   <ext:Label ID="lsdljsj" runat="server" Text="250" />
                                 </td>
                                </tr>
                                     
                                <tr>
                                 <td> 
                                  <ext:Button ID="btnTrader" runat="server" Text="Show Data">                                                                                                                                                        
                                    <Listeners>
                                       <Click Handler="addTab1(#{TabPanelCenter}, '3001', 'UserManagement/ManageYards.aspx','Manage Yards');"/>
                                    </Listeners>
                                  </ext:Button>
                                 </td>                                 
                                </tr>                                
                               </table>                                
                              </Body>
                             </ext:Portlet>
                            </ext:Anchor>
                            
                            <ext:Anchor>
                              <ext:Portlet ID="Portlet6" Shim="true" runat="server" Title="Purchase" Height="190" >
                                <Body>
                                  <ext:Button ID="btnPermit" runat="server" Text="Permit Details" >
                                    <Listeners>
                                      <Click Handler="addTab1(#{TabPanelCenter}, '12', 'Marketing/Permit/PermitList.aspx');"/>                               
                                   </Listeners>
                                 </ext:Button>                          
                               </Body>
                             </ext:Portlet>                   
                           </ext:Anchor>
                        </ext:AnchorLayout>
                     </Body>
                </ext:PortalColumn>
            </ext:LayoutColumn>
    </ext:ColumnLayout>    
             </Body>
            </ext:Portal>
          </ext:FitLayout>
    
                               
                     </Body>
                   </ext:Tab>
                  </Tabs>
                 </ext:TabPanel>
                </ext:FitLayout>
               </Body>
              </ext:Panel>            
             </Center>
  2. #2

    RE: Microsoft JScript runtime error

    Let me venture a guess here, maybe it's because you don't have a menu on your TabPanelCenter ?

    So either add a menu or remove that line.
  3. #3

    RE: Microsoft JScript runtime error

    ya i removed but its showing error like Microsoft JScript runtime error: Object doesn't support this property or method..
  4. #4

    RE: Microsoft JScript runtime error

    That's not perticulary helpful. Are you using any type of client-side debug tool?
  5. #5

    RE: Microsoft JScript runtime error

    no i im not using any tool...
    if i browse my project in mozilla firefox it is working fine..but in internet explore it is not working..

    if i remove this function
    tab.on('activate', function() and browse in internet explore it will be hanged or struck
    but in mozilla firefox im not facing any problem..
    ..
    tab.on('activate', function() 
                    {
                    
                       var item = TabPanelCenter.Anchor.Portal.get(id);
                       
                        if (item) {
                            TabPanelCenter.setSelection(item);
                        }
    
                    }, this);

Similar Threads

  1. Replies: 3
    Last Post: Apr 05, 2012, 10:55 AM
  2. Replies: 5
    Last Post: Mar 16, 2012, 2:47 PM
  3. Microsoft JScript runtime error: Object expected
    By shrenuj_dev in forum 1.x Help
    Replies: 0
    Last Post: May 11, 2011, 5:02 AM
  4. [CLOSED] getItemId - Microsoft JScript runtime error
    By asztern in forum 1.x Premium Help
    Replies: 2
    Last Post: Oct 04, 2010, 2:45 PM
  5. Microsoft JScript runtime error: 'Ext' is undefined
    By Satyanarayana murthy in forum Open Discussions
    Replies: 11
    Last Post: Mar 31, 2010, 11:54 AM

Posting Permissions