Object Expected Error when delcaring RadTab Client-side

4 posts, 0 answers
  1. Tom M
    Tom M avatar
    33 posts
    Member since:
    Nov 2009

    Posted 27 Aug 2010 Link to this post

    Greetings,

    I am getting "Error: Object expected" when creating a new RadTab. Any ideas what could be causing this? It makes no sense to me, and it only happens when the script resides in a RadWindow.

    function openingNewWindow(oWnd, title) {
        if (oWnd) {
            tabStrip.trackChanges();
            //create a new tab
            var tab = new Telerik.Web.UI.RadTab();
            //set the text of the tab
            tab.set_text(title);
            oWnd.correspondingTab = tab;
            //add the tab to the tabstrip
            tabStrip.get_tabs().add(tab);
            tabStrip.repaint();
            tab.correspondingWnd = oWnd;
            tab.set_imageUrl("../CSS/titlegraphic.gif");
            tabStrip.commitChanges();
            //Select this tab
            tab.select();
        }
    }


    Regards,
    Tom
  2. Yana
    Admin
    Yana avatar
    5043 posts

    Posted 30 Aug 2010 Link to this post

    Hello Tom,

    The provided script seems correct. Can you send us more details? Where the tabStrip variable is set?

    Regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Tom M
    Tom M avatar
    33 posts
    Member since:
    Nov 2009

    Posted 30 Aug 2010 Link to this post

    Hi Yana,

    Thanks for your reply. I was setting the tabstrip variable like this on pageLoad..
    function pageLoad() { 
        //get a reference to the needed controls - 
        var manager = GetRadWindow().get_windowManager(); 
        var tabStrip = $find("<%=RadTabStrip1.ClientID %>"); 
    }

    I think my problem was that I declared the openingNewWindow() function "twice". Once within my "main" page, and once in a page contained within a radWindow. Maybe this could mess things up? I was trying to use it like this because in my application you can open radwindows from within radwindows, and in both cases I need to add a reference to the MDI radTabStrip. I never resolved the issue but did wise-up and use the following approach successfully within the radwindowed page...

    //when opening a radWindow from the "main" page..
    function openingNewWindow(oWnd, title) {
        if (oWnd) {
            tabStrip.trackChanges();
            //create a new tab
            var tab = new Telerik.Web.UI.RadTab();
            //set the text of the tab
            tab.set_text(title);
            oWnd.correspondingTab = tab;
            oWnd.correspondingTabStrip = tabStrip;
            //add the tab to the tabstrip
            tabStrip.get_tabs().add(tab);
            tabStrip.repaint();
            tab.correspondingWnd = oWnd;
            tab.set_imageUrl("../CSS/titlegraphic.gif");
            tabStrip.commitChanges();
            //Select this tab
            tab.select();
        }
    }

    Then within the radwindowed page I just assign the tabStrip as such...

    function pageLoad() {
        //get a reference to the needed controls -
        manager = GetRadWindow().get_windowManager();
        tabStrip = GetRadWindow().correspondingTabStrip;
    }

    ...and when I need to call the "parent" page's openingNewWindow() function ( to add a tab item for the window to the tabstrip ) ....

    var oBrowserWnd = GetRadWindow().BrowserWindow;
    oWnd.moveTo(20, 30);
    oWnd.setSize(885, 475);
    oWnd.setActive();
    oBrowserWnd.openingNewWindow(oWnd, "Title");

    Regards,
    Tom
  4. Yana
    Admin
    Yana avatar
    5043 posts

    Posted 02 Sep 2010 Link to this post

    Hi Tom,

    Could you please open a support ticket and send us a runnable pages demonstrating this issue as I'm not able to understand the exact approach. Thanks in advance

    All the best,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top