[CLOSED] Reload Parent TabPanel after closing child window

  1. #1

    [CLOSED] Reload Parent TabPanel after closing child window

    I have a tabpanel with gridpanel, the gridpanel has a commandcolumn which call a child window. I'd like it after that child window closes (using function from the child's codebehind), the parent's tabpanel reloads. there's a function to reload the tabpanel on the parent's codebehind. My question is, how to call a function on the parent's codebehind from the child window's codebehind.

    here is my code

    parentform.aspx

    <ext:TabPanel ID="TabPanel1" runat="server">
                                  <Items>
                                        <ext:Panel ID="TabPrcs" runat="server" Title="Process">
                                            <Items>
                                                <ext:FormPanel
                                                ID="FormPrcs"
                                                runat="server"
                                                Title=""
                                                BodyStyle="background-color: #DFE8F6"
                                                BodyPadding="10"
                                                Margins="0 5 0 5"
                                                Frame="true"
                                                Split="true">
                                                    <Items>
                                                        <ext:GridPanel
                                                            ID="GridPrcs"
                                                            runat="server"
                                                            >
                                                            <Store>
                                                            <ext:Store ID="storePrcsDoc"  runat="server">
                                                            <Model>
                                                                <ext:Model runat="server" ID="Model5">
                                                                    <Fields>
                                                                        <ext:ModelField Name="VendorName" Type="String" />
                                                                        <ext:ModelField Name="ReqDate" Type="String" />
                                                                        <ext:ModelField Name="DocDate" Type="String" />
                                                                        <ext:ModelField Name="ExpDate" Type="String" />
                                                                        <ext:ModelField Name="CloseStatus" Type="String" />
     
                                                                     </Fields>
                                                                </ext:Model>
                                                            </Model>
                                                            </ext:Store>
                                                            </Store>
                                                            <ColumnModel ID="ColumnPrcs" runat="server">
                                                                <Columns>
                                                                    <ext:Column ID="Column32" runat="server" Text="Name" DataIndex="Name" flex="1">
                                                                    </ext:Column>
                                                                    <ext:Column ID="Column33" runat="server" Text="Date" DataIndex="Date" width="100">
                                                                    <Renderer Format="Date" FormatArgs="'d-M-Y'" />
                                                                    </ext:Column>                                                               
                                                                    <ext:CommandColumn ID="btnDetaildocsPrcs" runat="server" Width="58">
                                                                    <Commands>
                                                                        <ext:GridCommand Icon="NoteEdit" CommandName="Detail" StandOut="true" Text="Detail">
                                                                            <ToolTip Text="View Detail" />
                                                                        </ext:GridCommand>
                                                                    </Commands>
                                                                    <DirectEvents>
                                                                        <Command OnEvent="DetailDocsPrcs_click">
                                                                            <ExtraParams >
                                                                                <ext:Parameter Name="record" value="Ext.encode(#{GridPrcs}.getRowsValues({selectedOnly:true}))" Mode="Raw" Encode="true" />
                                                                            </ExtraParams>
                                                                        </Command>
                                                                    </DirectEvents>
                                                                    </ext:CommandColumn>
                                                                </Columns>
                                                            </ColumnModel>       
                                                        <View>
                                                            <ext:GridView runat="server" StripeRows="true" TrackOver="true" />
                                                        </View>      
                                                    </ext:GridPanel>
                                                    <ext:ToolTip
                                                        runat="server"
                                                        Target="={#{GridPrcs}.getView().el}"
                                                        Delegate=".x-grid-cell"
                                                        TrackMouse="true">
                                                        <Listeners>
                                                            <Show Handler="onShow(this, #{GridPrcs});" />
                                                        </Listeners>
                                                    </ext:ToolTip>
                                                    </Items>                          
                                                </ext:FormPanel>
                                           </Items>
                                        </ext:Panel>
                                     </Items>
                                </ext:TabPanel>
    parentform.aspx codebehind

    Public Sub DetailDocsPrcs_click(ByVal sender As Object, ByVal e As EventArgs)
     
            If X.IsAjaxRequest Then
     
                Dim win As New Window
               
                Try
                    With win
                        .Title = "Document"
                        .Width = Unit.Pixel(950)
                        .Height = Unit.Pixel(500)
                        .Modal = False
                        .Collapsible = True
                        .Maximizable = True
                        .Loader = New ComponentLoader With
                            {
                                .Url = "../childform.aspx,
                                .Mode = LoadMode.Frame,
                                .AutoLoad = True
                            }
                        .Render(Me.Form)
                        .Show()
                    End With
                Catch ex As Exception
                    ErrHandler(ex, btnDetaildocsPrcs)
                End Try
     
            End If
     
        End Sub
    childform.aspx

    <td Width="100">
        <ext:Button ID="SubmitButton" runat="server" Text="Execute" ToolTip="Submit" Width="100" align= "right">
            <DirectEvents>
                <Click OnEvent="SubmitButton_Click">
                    <EventMask ShowMask="true" Msg="Processing..." MinDelay="10"/>
                    <ExtraParams>
                       <ext:Parameter Name="Items" Value="Ext.encode(#{GridItems}.getRowsValues({selectedOn:true}))" Mode="Raw" />
                    </ExtraParams>
                </Click>
            </DirectEvents>
        </ext:Button>
        </td>
    I need to call the function loadtabpanel() on parent codebehind to reload the parent tabpanel after the child closes.

    childform.aspx codebehind

    Public Sub SubmitButton_Click(ByVal sender As Object, ByVal e As DirectEventArgs) Handles SubmitButton.Click
            If X.IsAjaxRequest Then
                   X.Js.AddScript("parentAutoLoadControl.hide();")
                  parent.loadtabpanel()
            End If
    End Sub
    Last edited by Daniil; Apr 09, 2014 at 1:43 AM. Reason: [CLOSED]
  2. #2
    Hi @redi,

    In a child's code behind you can do:
    X.Js.Call("parent.App.direct.DirectMethodInParent");
  3. #3
    Hi Daniil,

    Thanks for your response but I can't seem to use that function. Aren't that function is for calling javascript? What I'd like to do is to call the function loadtabpanel() on parent's codebehind from the child's codebehind.
  4. #4
    There is no way to call a parent's code behind method directly from a child's code behind. I demonstrated the only way to access a parent's code behind method.

Similar Threads

  1. Replies: 2
    Last Post: Apr 04, 2014, 9:25 PM
  2. Closing Window from child page
    By stebag in forum 2.x Help
    Replies: 5
    Last Post: Dec 12, 2013, 4:12 PM
  3. [CLOSED] Problem: Closing Maximized Window will loose parent window scrollbar
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 19, 2012, 8:51 PM
  4. Replies: 7
    Last Post: Feb 09, 2012, 11:17 AM
  5. Reload Parent Window from Child Window
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Sep 08, 2009, 10:54 AM

Tags for this Thread

Posting Permissions