Add Tab to Parent from within IFrame

  1. #1

    Add Tab to Parent from within IFrame

    Hi,

    We've used the AutoLoad URL on a TabPanel to load via Merge mode a new view into a panel. What we need to be able to do though is, add a new tab onto the TabPanel. From an example on this site we tried:

    var addTab = function (tabPanel, id, url, title, closable) {
                var tab = tabPanel.getComponent(id);
                if (!tab) {
                    tab = tabPanel.add({
                        id: id,
                        title: title,
                        closable: closable,
                        autoLoad: {
                            showMask: true,
                            url: url,
                            mode: "iframe",
                            maskMsg: "Loading " + url + "..."
                        }
                    });
                }
                tabPanel.setActiveTab(tab);
            }
    .. and fired an event:

    <ext:Button runat="server" ID="btnTest" Text="Test">
                    <Listeners>
                        <Click Handler="addTab(#{tabPnlChild2}, 'idGgl', 'http://www.google.com', 'Google', true);" />
                    </Listeners>
                </ext:Button>
    In this case it says object doesnt support this property or method on the tabPanel.getComponent(id) line. Am I doing something wrong? We're using Ext.NET, not the extjs library directly.. it occurs to me that getComponent is an extjs method, is it not? Would I need to add a reference to the .js files for this to work, or should this be ok?

    Cheers,
    Peter
  2. #2
    You can close this thread; I resolved my problem by switchig to IFrame mode and using:


    parent.tabPnlChild2.add({ ..... });

Similar Threads

  1. [CLOSED] Accessing Parent from Iframe
    By stoque in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Jun 03, 2011, 9:10 PM
  2. Replies: 0
    Last Post: Sep 21, 2010, 7:33 PM
  3. [1.0] IFrame communication with parent page
    By olakara in forum 1.x Help
    Replies: 1
    Last Post: Apr 20, 2010, 9:00 AM
  4. [CLOSED] [1.0] IFrame, parent window question.
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 15, 2010, 12:26 PM
  5. Replies: 0
    Last Post: Jun 24, 2009, 4:53 PM

Tags for this Thread

Posting Permissions