Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
WebTab to call the content page's event when switching the tab
posted

Hi,

I would like to know. Is it possible to call the content page's event when switching the tab.

For example, there are several tabs. Each tab has a content url page set.

Now if the user finished the tab1 data input, and switch to the tab2.

I want to save tab1 content page data back to db before the tab2 content page showing.

Since I have tried to use HTML body onunload for the content page, but when switch tab it didn't make any event to the previous content page.

Parents
No Data
Reply
  • 15979
    Suggested Answer
    posted

    Hello jshiu,

    If you want to do this on Client-Side you can use “ClientEvents-ActiveTabChange” client event handler (if you have Activation enabled) or “ClientEvents-SelectedIndexChanging” (cancelable event)/ClientEvents-SelectedIndexChanged” (fired after selected Tab is changed) and do your modifications in this events:

    function WebTab1_SelectedIndexChanging(sender, e) {

     

             //Gets the new selected index

             var newIndex = e.get_tabIndex();

     

             //Gets the old selected index

             var oldIndex = e.get_oldTabIndex();

     

             if(oldIndex == 2)

     

                //Cancels the SelectedIndexChanging event

                e.set_cancel(true);                        

     

    }

    http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/Infragistics4.Web.v10.3~Infragistics.Web.UI.LayoutControls.TabClientEvents~SelectedIndexChanging.html

    If you want to do this on Server-Side you can use “SelectedIndexChanged” event which will give you access to the new and old selected tabs:

    protected void WebTab1_SelectedIndexChanged(object sender, Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs e)

        {

            string newTabText = WebTab1.Tabs[e.NewIndex].Text;

     

            string oldTabText = WebTab1.Tabs[e.OldIndex].Text;

           

        }

     

    Let me know if you have further questions.

Children