Ext.net TabPanel issue

  1. #1

    Ext.net TabPanel issue

    I'm experiencing an issue with Ext.net TabPanel. When the page with tab panel is opened first time after the app was rebuilt it throws Uncaught TypeError: Object [object Object] has no method 'getComponent'. The problem happens each time the application is rebuilt and then disappears after page refresh. Here's JS code I use to create a tab:

    @X.XScript().ScriptBlock(@"
    <script>
        var addMainTab = function (tabPanel, id, url, title) {
    
            var tab = tabPanel.getComponent(id);
    
            if (!tab) {
                tab = tabPanel.add({ 
                    id       : id, 
                    title    : title, 
                    closable : true,
                    loader   : {
                        url      : url,
                        renderer : 'frame',
                        loadMask : {
                            showMask : true,
                            msg      : 'Loading ' + url + '...'
                        }
                    }
                });
            }
    
            tabPanel.setActiveTab(tab);
        }
    </script>
    ");
    It's called on menu item click:

    menuItem.Listeners.Click.Handler = "addMainTab(#{MainTabPanel}, 'someId', 'someurl', 'Tab title')";
    As I figured out some functions (getComponent, addTab and others) are not included into the definition of TabPanel at first load of the page after rebuild. Does anyone have any idea why it may happen and how it can be fixed? I'd appreciate any help.
  2. #2
    Please provide runable sample for testing
  3. #3
    Quote Originally Posted by Vladimir View Post
    Please provide runable sample for testing
    Vladimir, I've created a small MVC project with TabPanel in Layout page. You can find it here: https://bitbucket.org/abylinsky/ext....nel-issue/src/

    When you open the app first time after rebuild and click on menu items in the left menu, you'll get Uncaught TypeError: Object [object Object] has no method 'getComponent'.
  4. #4
    You cannot use #{} syntax under Razor (it is webform only)
    Please replace by #{MainTabPanel} by App.MainTabPanel or Ext.getCmp('MainTabPanel')
  5. #5
    Quote Originally Posted by Vladimir View Post
    You cannot use #{} syntax under Razor (it is webform only)
    Please replace by #{MainTabPanel} by App.MainTabPanel or Ext.getCmp('MainTabPanel')
    Thanks a lot, Vladimir! It worked for me. However I must admit that this was the only case when #{} syntax didn't work in our app. In all the other cases it worked very well even under Razor engine.
  6. #6
    Just #{} synatx has no sense under Razor and should not be used

Similar Threads

  1. [CLOSED] [#9] TabPanel Loader issue
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Jan 21, 2015, 2:45 PM
  2. [CLOSED] Issue with Gridpanel example and Tabpanel
    By trezv in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 02, 2012, 2:51 PM
  3. [CLOSED] Tabpanel + content issue
    By reinout.mechant@imprss.be in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 24, 2009, 11:07 AM
  4. [CLOSED] TabPanel issue?
    By drgw74 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 11, 2009, 10:08 AM
  5. TabPanel and ComboBox (Layout issue)
    By Timothy in forum Bugs
    Replies: 1
    Last Post: Sep 06, 2008, 3:04 PM

Tags for this Thread

Posting Permissions