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
Hello Robert,
StateChanged event should be fired always when you change the window state. Otherwise this can be thread as an issue.
You can use: var dw = $find('<%= popViewDocument.ClientID %>');dw.show(); //dw.hide();http://forums.infragistics.com/forums/p/46189/250279.aspx#250279
Hope this helps
The link sent seems to be not much to do with the context of this discussion. Notice that I'm trying to trigger a postback upon change of the state of the WebDialogWindow. As stated originally this does work if I click the 'X' in the top right-hand corner. But does not trigger if I create my own button on the form.
Just FYI:
By the way I didn't mention that the contents of the WebDialogWindow's contents actually come from another document .aspx - by setting the 'contentPane.set_contentUrl'. But I don't think that should make a difference. However that is why my '$find' statement is formatted the way it is above. But this should not affect my overall problem/question.
Sincerely,