[CLOSED] Unable to close dynamic Window

  1. #1

    [CLOSED] Unable to close dynamic Window

    Hi,

    I am creating a dynamic window on Page1.aspx through the function "renderViewRepWin" which redirects to another page (Page2.aspx).
    Page2.aspx in turn open's its own window to display a report.
    I would like to close the dynamic window on Page1.aspx after the redirect to Page2.aspx.

     Private Shared Function renderViewRepWin(ByVal recid As String, ByVal prodid As String, ByVal WindowsID As String, WindowTitle As String)
    
            Using wViewReport As New NetAlias.Window() With {.ID = WindowsID, .Width = "800", .Header = True, .Title = WindowTitle, .CloseAction = NetAlias.CloseAction.Close, .Height = "600"}
                With wViewReport
    
                    'Create a 'Back' for Panel 
                    Dim tBar As New NetAlias.Toolbar()
                    Dim bBack As New NetAlias.Button("Back", "history.back(-1)") With {.Icon = NetAlias.Icon.ArrowLeft}
                    tBar.Add(bBack)
    
                    Dim bPrinter As New NetAlias.Button("Print", String.Format("printSelection(document.getElementById('{0}_IFrame'));return false;", WindowsID)) With {.Icon = NetAlias.Icon.Printer}
    
                    tBar.Add(bPrinter)
                    .TopBar.Add(tBar)
    
                    With .Listeners
                        With .Close
                            .Handler = "myGrid.getStore().reload(null);"
                        End With
                    End With
    
                    .AutoLoad.Url = "Page2.aspx"
                    .AutoLoad.Method = NetAlias.HttpMethod.POST
                    .AutoLoad.Mode = NetAlias.LoadMode.IFrame
                    .AutoLoad.Params.Add(New NetAlias.Parameter("RecordID", recid))
                    .AutoLoad.Params.Add(New NetAlias.Parameter("ProdID", prodid))
    
                    .Render()
                    .Hidden = True
                End With
    
            End Using
    
    
        End Function
    I also tried Redirecting to Page2.aspx (using Ext.Net.X.Redirect) without having to open a dynamic window as above, but I could not get the code to do a postback to reload Page1.aspx.

    Thanks

    Ravi Swaminathan
    Last edited by Daniil; Feb 28, 2012 at 2:35 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I'm afraid I don't understand the requirement well.

    Generally, to access a parent page Window, you should use "parent" reference on client side.
    parent.WindowClientId.hide();
    To execute JavaScript from server side during DirectEvent you can use the code like this:
    X.Js.AddScript("parent.WindowClientId.hide();");
  3. #3

    Re: Unable to close dynamic Window

    Thanks very much, Daniil, that worked, closing the parent window.

    Just out of curiosity, is there a way i could force a post back from code-behind on the ext page?

    Thanks

    Ravi
  4. #4
    Quote Originally Posted by wisdomchuck View Post
    Just out of curiosity, is there a way i could force a post back from code-behind on the ext page?
    Please start a new forum thread.

Similar Threads

  1. [CLOSED] how to close window after click button in this window
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 22, 2012, 2:48 PM
  2. Replies: 2
    Last Post: May 15, 2012, 7:48 AM
  3. [CLOSED] How to remove 'X' (window close) for popup window?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 31, 2011, 3:50 AM
  4. [CLOSED] Problem to close Window which has another Window inside
    By asztern in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 21, 2010, 5:33 PM
  5. Close dynamic window
    By Dominik in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2010, 8:47 AM

Posting Permissions