Need help with Ajax Tab

  1. #1

    Need help with Ajax Tab

    Hi,

    I'm building a dynamic tabpanel which build the tabs base on user setting. Here's the code that build the tab
               // Start adding individual tab
                CL.Tab tab = new CL.Tab();
                tab.ID = tabID;
                tab.Title = sTitle;
                tab.Height = 498;
                tab.AutoScroll = true; 
                      
                tab.AutoLoad.Url = "chartTab.aspx?VTID=" + iTypeID.ToString();
                tab.AutoLoad.ShowMask = true;
                tab.AutoLoad.MaskMsg = "Loading...";
                tab.AutoLoad.Mode = CL.LoadMode.IFrame;
                tpWinSight.Tabs.Add(tab);
    My question is, can I use a javascript function to render the URL for me and put in the tab.AutoLoad.Url like this:
    ...
               tab.AutoLoad.Url = someJavascriptFunct(iID);
    ...
    I try to put the javascript function in there but it render "someJavascriptFunct(iID)" as string instead of the result of that javascript function.

    Thanks
    newbie


  2. #2

    RE: Need help with Ajax Tab

    Hi lo230c,

    I thought this should work, but there was a defect in how the AutoLoad property was being serialized.

    I fixed the defect, which enables the following code.

    Example

    <script type="text/javascript">
        var getUrl = function() {
            return "http://www.google.com/";
        };
    </script>
    
    <ext:Panel ID="Panel1" runat="server" Height="400" Width="600">
        <AutoLoad Url="={getUrl()}" Mode="IFrame" />
    </ext:Panel>
    The "={}" part is a "raw token" and wraps the "getUrl()" function call and instructs the parser to output the contents of token directly to the configuration script.

    The bug fix will be included with the upcoming v0.8 release.

    Geoffrey McGill
    Founder
  3. #3

    RE: Need help with Ajax Tab

    Woohoo, I found the bug...:) Thanks for your quick response. Geoffrey.

    By the way I was able to use CustomConfig in insert the javascript custom function to autoLoad property and it works for now.

    thanks
    lo230c


  4. #4

    RE: Need help with Ajax Tab

    hi

    i want to do the same thing.....but it gives the following error

    " The resource you are looking for (or one of its dependencies)
    could have been removed, had its name changed, or is temporarily
    unavailable."

    thnx

Similar Threads

  1. UserControl Ajax
    By vikramsahai08 in forum 1.x Help
    Replies: 4
    Last Post: Jun 24, 2009, 11:17 AM
  2. Page_ Ajax Load Complete BUG on Ajax Request
    By jeybonnet in forum 1.x Help
    Replies: 8
    Last Post: Jun 22, 2009, 11:19 AM
  3. Ajax Events - please help!!
    By EzaBlade in forum 1.x Help
    Replies: 2
    Last Post: Mar 27, 2009, 10:26 AM
  4. ajax method
    By [WP]joju in forum 1.x Help
    Replies: 4
    Last Post: Feb 06, 2009, 6:43 AM

Posting Permissions