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
1708
non-standard close button not triggering statechange event
posted

I’m using a WebDialogWindow to popup a modal window.  It is attached to a parent form.  It is actually an editor for more than one form.  The modal window has naturally a close button in the top right-handcorner, however I have added another close button of my own.  This button that I added does not raise the ‘WindowStateChange’ event on the parent form.  Nor have found any way to access the parent form from the modal window page code behind.  (.parent = nothing or null  master is the same).  It is different if use the ‘X’ in the top right-hand corner.  It triggers the post-back.  Then I can write the new information that was changed to the parent-form on post-back.  Ultimately my modal window edits something on the parent, and when it closes I want to refresh the parent with the new information.  But doing that seems easier than saying it.

Parent Page Code:

<ig:WebDialogWindow ID="popViewDocument" runat="server" Height="600px"      InitialLocation="Centered" Modal="True" Width="800px" WindowState="Hidden" OnStateChanged="popViewDocument_StateChanged" >

      <AutoPostBackFlags WindowStateChange="On" />

      <Header CaptionText="Patient Edit" runat="server">

      </Header>

</ig:WebDialogWindow>

 

Protected Sub popViewDocument_StateChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.DialogWindowStateChangedEventArgs) Handles popViewDocument.StateChanged

        If e.NewState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden Then

       …>>>>>> Only gets triggered on ‘X’ click – Why not a button click???!

      

Close button code on Modal popup page:

Protected Sub btClose_Click(ByVal sender As Object, ByVal e As EventArgs) Handles       btnCloseForm.Click

        If Not ClientScript.IsStartupScriptRegistered("closeDialogWindow") Then

            Page.ClientScript.RegisterStartupScript(Me.GetType(), "closeDialogWindow", "closeDialogWindow();", True)

        End If

End Sub

 

>>>Javascript
<script type="text/javascript">

     function closeDialogWindow() {

         var dialogWindow = this.parent.$find("MainContent_popViewDocument");

         dialogWindow.hide();

     }

</script>

 

 

 Thankx,

Robert Koernke

Parents Reply Children