This is a migrated thread and some comments may be shown as answers.

RadTabStrip and RadMultiPage dynamic reload

2 Answers 258 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
KO
Top achievements
Rank 1
KO asked on 06 Jun 2012, 07:16 PM
What I am trying to accomplish is writing a javascript function that when called from the click of a page element does the tabbing and changing of the of the RadTabStrip and RadMultiPage, with the option of passing a query string. However, I would like the option of passing in another boolean parameter that will notify the "sending" tab the next time it is clicked, it needs to reload its content. I have had some success in changing the RadTabStrip and RadMultiPage from my script, as well as the using the query string by changing the ContentUrl of the "target" PageView, but have been experiencing a lot of trouble in figuring out how to get the "sending" tab to reload its PageView.

Current JS file:
function ToolClick(sender, args, queryString, targetPageIndex, refreshSendingPage) {
    var revertContentUrl = false;
 
    // get the multi page ID, and tab strip ID, from the SiteAuthenticated script
    var multiPageID = top.GetMultiPageID();
    var multiPage = top.$find(multiPageID);
    var tabStripID = top.GetTabStripID();
    var tabStrip = top.$find(tabStripID);
 
    // get the target page view, and get its pre Tab Content URL for reverting after selection
    var multiPageViews = multiPage.get_pageViews();
    var targetPageView = multiPageViews._data[targetPageIndex];
    var preTabPageContentUrl = targetPageView.get_contentUrl();
 
    // change the page View's ContentUrl if the queryString was supplied
    if (queryString != null && queryString.length > 0) {
        targetPageView.set_contentUrl(preTabPageContentUrl + queryString);
        revertContentUrl = true;
    }
 
    // if refreshSendingPage is true then set the tab we are leaving to PostBack on next click
    if (refreshSendingPage) {
        var currentTab = tabStrip.get_selectedTab();
        currentTab.set_value("reload");
    }
 
    // do the tab change
    tabStrip.get_tabs()._array[targetPageIndex].select();   
 
    // if we changed the contentUrl for the query then change it back
    //if (revertContentUrl) {
    //    targetPageView.set_contentUrl(preTabPageContentUrl);
    //}
}
 
// to be used in determining if the tab needs to postBack or not
function TabStrip_OnTabSelecting(sender, args) {
    var selectingTab = args.get_tab();
    // check tab values for post back
    if (selectingTab.get_value() == "reload") {
        // the tab is set to post back so unload and reload the related pageView
    }
}


Thank you in advance for assistance.

2 Answers, 1 is accepted

Sort by
0
KO
Top achievements
Rank 1
answered on 07 Jun 2012, 04:15 PM
I was able to solve this
0
Anton
Top achievements
Rank 1
answered on 10 Aug 2012, 05:40 AM
Hi KO

Can you please share the solution on how you solved this?
I am struggling with the same thing .

Thank you very much .

Tags
TabStrip
Asked by
KO
Top achievements
Rank 1
Answers by
KO
Top achievements
Rank 1
Anton
Top achievements
Rank 1
Share this question
or