[CLOSED] Window-->Tab Panel has several tabs, each loading same Child Page...... I want to call JS function in child from Window

  1. #1

    [CLOSED] Window-->Tab Panel has several tabs, each loading same Child Page...... I want to call JS function in child from Window

    Hi,
    I have a bit of an issue.
    I have a window, inside I have a tab panel. The tabpanel loads a child panels defined on page load, with different parameters to represent different content for each tab.
    In the child page, I have a js function SaveModifiedRecords, which in turn calls an App.direct function that calls a method on the server in the Child Page.

    How, from the button defined on the Very top window ( the one hosting the TabPanel) , can I call this for the correct tab (activeTab)?

    I tried getting the body of the active Tab:

    App.ContentPlaceHolder1_TabPanel1.getBody().SaveMo difiedRecords.call() <-- NO LOVE

    I tried getting the tabpanel specifically:

    App.ContentPlaceHolder1_SubTab213.getBody().SaveMo difiedRecords.call() <-- NO LOVE

    How can I get to the body of a panel, who's content is loaded via a loader..so I can call a Javascript function in it?

    The panels in the tab are defined as so:
    private Panel CreatePanel(DebtLeverageSubsidiary sub)
            {
                string loadingString = (!string.IsNullOrEmpty(sub.Title)) ? "Loading Maturity Schedule for " + sub.Title + "..." : "Loading Maturity Schedule..";
    
    
                Ext.Net.Panel panel = new Ext.Net.Panel
                {
                    Border = false,
                    Title = sub.Title,
                    ID = "SubTab" + sub.DebtLeverageSubsidiaryId.ToString(),
                    Height = 390,
                    BodyStyle = "background-color:transparent;",
                    Loader = new ComponentLoader
                    {
                        LoadMask =
                        {
                            Msg = loadingString,
                            ShowMask = true
                        },
                        AutoLoad = true,
                        Mode = LoadMode.Frame,
                        DisableCaching = true,
                        Url = "MaturityEditor.aspx",
                        Params =  
                           {
                                 new Ext.Net.Parameter( "bsId",bsId.ToString(),Ext.Net.ParameterMode.Raw ),
                                 new Ext.Net.Parameter( "portId",portId.ToString(),Ext.Net.ParameterMode.Raw ),
                                 new Ext.Net.Parameter( "subId",sub.DebtLeverageSubsidiaryId.ToString(),Ext.Net.ParameterMode.Raw ),
                                 new Ext.Net.Parameter( "year",year.ToString(),Ext.Net.ParameterMode.Raw ),
                                 new Ext.Net.Parameter( "quarter",quarter.ToString(),Ext.Net.ParameterMode.Raw )  
                           }
                    }
                };
                return panel;
            }
    Last edited by Daniil; Feb 10, 2014 at 6:15 AM. Reason: [CLOSED]
  2. #2
    Calling the following will get you an instance of the Child Page:

    App.ContentPlaceHolder1_SubTab213.getBody()
    Then you need to call the path to the DirectMethod, which should be the following:

    App.direct.SaveModifiedRecords()
    Putting it all together, the following should work:

    App.ContentPlaceHolder1_SubTab213.getBody().App.direct.SaveModifiedRecords()
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    The above is assuming "ContentPlaceHolder1_SubTab213" is the client-side ID of the Tab.
    Geoffrey McGill
    Founder
  4. #4
    Quote Originally Posted by geoffrey.mcgill View Post
    The above is assuming "ContentPlaceHolder1_SubTab213" is the client-side ID of the Tab.

    Hi Geoff:
    Calling:
    alert(App.ContentPlaceHoolder1_SubTab213.getBody() ) returns undefined....

    returned:


    Here is how the tabPanel panels are rendered:
    private Panel CreatePanel(DebtLeverageSubsidiary sub)
    		{
    			string loadingString = (!string.IsNullOrEmpty(sub.Title)) ? "Loading Maturity Schedule for " + sub.Title + "..." : "Loading Maturity Schedule..";
    
    
    			Ext.Net.Panel panel = new Ext.Net.Panel
    			{
    				Border = false,
    				Title = sub.Title,
    				ID = "SubTab" + sub.DebtLeverageSubsidiaryId.ToString(),
    				Height = 390,
    				BodyStyle = "background-color:transparent;",
    				Loader = new ComponentLoader
    				{
    					LoadMask =
    					{
    						Msg = loadingString,
    						ShowMask = true
    					},
    					AutoLoad = true,
    					Mode = LoadMode.Frame,
    					DisableCaching = true,
    					Url = "MaturityEditor.aspx",
    					Params =  
    					   {
    							 new Ext.Net.Parameter( "bsId",bsId.ToString(),Ext.Net.ParameterMode.Raw ),
    							 new Ext.Net.Parameter( "portId",portId.ToString(),Ext.Net.ParameterMode.Raw ),
    							 new Ext.Net.Parameter( "subId",sub.DebtLeverageSubsidiaryId.ToString(),Ext.Net.ParameterMode.Raw ),
    							 new Ext.Net.Parameter( "year",year.ToString(),Ext.Net.ParameterMode.Raw ),
    							 new Ext.Net.Parameter( "quarter",quarter.ToString(),Ext.Net.ParameterMode.Raw )  
    					   }
    				}
    			};
    			return panel;
    		}
  5. #5
    App.[ClientID].getBody() is what you need to call. Replace [ClientID] with the client-side ID of the component.

    You should be able to get the client-side ID of the component by calling .ClientID on that Component, after it has been added to the Controls Collection of the Page.
    Geoffrey McGill
    Founder
  6. #6
    Quote Originally Posted by geoffrey.mcgill View Post
    App.[ClientID].getBody() is what you need to call. Replace [ClientID] with the client-side ID of the component.

    You should be able to get the client-side ID of the component by calling .ClientID on that Component, after it has been added to the Controls Collection of the Page.

    Got it.

    Just had to call:
    App.ContentPlaceHolder1_TabPanel1.getActiveTab().getBody().SaveModifiedRecordsMat().
    Thanks!!
    Last edited by Daniil; Feb 10, 2014 at 6:14 AM. Reason: Please use [CODE] tags

Similar Threads

  1. Closing Window from child page
    By stebag in forum 2.x Help
    Replies: 5
    Last Post: Dec 12, 2013, 4:12 PM
  2. Replies: 6
    Last Post: Feb 15, 2012, 4:15 PM
  3. [CLOSED] [1.0] Call to grid function from child window
    By edigital in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 16, 2010, 8:41 AM
  4. [CLOSED] How to call a javascript function from a child page?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 25, 2010, 5:40 PM
  5. [CLOSED] call function from child window
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Apr 29, 2009, 3:31 PM

Posting Permissions