[CLOSED] Error setting active tab

  1. #1

    [CLOSED] Error setting active tab

    Hello, the code below causes me a Javascript error, if I open the page and click the button:
    Error: Unable to get value of the property 'dom': object is null or undefined
    How can I set the active tab from code behind?
    How can hide the Panel1?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ExtNetTestTabsDirectEvents.WebForm1" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
      <title>Ext.Net test</title>
    </head>
    <body>
      <ext:ResourceManager runat="server" DisableViewState="False" ID="ResourceManager1">
      </ext:ResourceManager>
      <ext:Viewport runat="server" Layout="Border" ID="Viewport1">
        <Items>
          <ext:Panel runat="server" Title="Test for click" Region="West" ID="PanelLeft" Width="250">
            <Items>
              <ext:Button runat="server" ID="Bt1" Text="Click me to update panels">
                <Listeners>
                  <Click Handler="App.direct.ElementClicked(); return false;">
                  </Click>
                </Listeners>
              </ext:Button>
            </Items>
          </ext:Panel>
          <ext:TabPanel runat="server" ID="Tabs" Region="Center" Title="All Panels">
            <Items>
              <ext:Panel runat="server" Title="Pannello1" ID="Panel1">
                <Content>
                  Prova
                </Content>
              </ext:Panel>
              <ext:Panel runat="server" Title="Pannello2" ID="Panel2">
                <Loader Url="Default.aspx" ID="Loader1" Mode="Frame" AutoLoad="True">
                  <LoadMask ShowMask="True" />
                </Loader>
              </ext:Panel>
            </Items>
          </ext:TabPanel>
        </Items>
      </ext:Viewport>
      <script runat="server">
        [DirectMethod]
        public void ElementClicked()
        {
          var panel = new Ext.Net.Panel("Pannello3")
          {
            Loader = new ComponentLoader
            {
              AutoLoad = true,
              Url = "http://www.ext.net",
            }
          };
          panel.AddTo(Tabs);
          Panel2.LoadContent("http://www.sbg.it");
          Tabs.SetActiveTab(Panel2);
        }
      </script>
    </body>
    </html>
    Last edited by Daniil; Jul 18, 2012 at 3:31 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I am unable to reproduce that error.

    If you use 2.0, I would recommend to update to 2.1:
    http://svn.ext.net/premium/branches/2.1/

    Does the error still happen?

    Regarding
    Tabs.SetActiveTab(Panel2);
    I think it's a bug and thanks for the report.

    Please use
    Tabs.SetActiveTab("Panel2");
    for now.
  3. #3
    Quote Originally Posted by Daniil View Post
    I am unable to reproduce that error.

    If you use 2.0, I would recommend to update to 2.1:
    http://svn.ext.net/premium/branches/2.1/

    Does the error still happen?
    I am able to reproduce with 2.0. To fix please replace
    Panel2.LoadContent("http://www.sbg.it");
    Tabs.SetActiveTab(Panel2);
    with
    Tabs.SetActiveTab(Panel2);
    Panel2.LoadContent("http://www.sbg.it");

    Quote Originally Posted by Daniil View Post
    Regarding
    Tabs.SetActiveTab(Panel2);
    I think it's a bug and thanks for the report.

    Please use
    Tabs.SetActiveTab("Panel2");
    for now.
    The fix has been added to SVN for both 2.0 and 2.1. Thanks again for the report.
  4. #4
    Quote Originally Posted by Daniil View Post
    The fix has been added to SVN for both 2.0 and 2.1. Thanks again for the report.
    Thanks for your support. What about hiding Panel1?
    I tried via Javascript (Icannot find how to do it in code behind):

    App.Panel1.tab.hide();
    but I still get a javascript error.

    Thank you again in advance
  5. #5
    Quote Originally Posted by sbg View Post
    Thanks for your support. What about hiding Panel1?
    I tried via Javascript (Icannot find how to do it in code behind):

    App.Panel1.tab.hide();
    but I still get a javascript error.

    Thank you again in advance
    Never mind, I updated from SVN and it works like a charm now.

    Thank you again

Similar Threads

  1. [CLOSED] Error when binding KeyMap to not active Panel in TabPanel
    By Fredrik in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 02, 2012, 1:52 PM
  2. [CLOSED] The active error of a composite field is not nice
    By thchuong in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 24, 2010, 8:55 AM
  3. [CLOSED] Error setting the combo icon
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 05, 2010, 4:12 PM
  4. [CLOSED] Error while setting theme in web.config
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 25, 2008, 6:54 AM
  5. Replies: 1
    Last Post: Oct 28, 2008, 6:34 AM

Tags for this Thread

Posting Permissions