Hello,
I'd like to run some code in my ASP.NET code-behind when my web dialog window is shown. The WindowsState of it is hidden. I'm then showing it with the following BLOCKED SCRIPT
$find('incSection1_myWebDialog').show();
I have break point on the sub declaration in an event handler defined in my pages code behind that I'm not seeing get hit:
Protected Sub stateChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.DialogWindowStateChangedEventArgs) Handles myWebDialog.StateChanged End Sub
When does the StateChanged get fired? I have breakpoints on event handlers for the .Init and .PreRender events of my web dialog window and I see them get hit when my page is first loaded.
-Eric
Hello Victor,
Based on your post I tried:
<cc1:WebDialogWindow ID="myWebDialog" runat="server" Height="200px" InitialLocation="Centered" Modal="True" Width="700px" MaintainLocationOnScroll="True" BorderStyle="Inset" BorderWidth="2px" WindowState="Hidden" >function myFunction() { var dialog = $find('incAttachments1blMyTable_myWebDialog') dialog.set_windowState($IG.DialogWindowState.Normal, true);} Protected Sub myWebDialog_StateChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.DialogWindowStateChangedEventArgs) Handles myWebDialog.StateChanged End Sub
Doing the dialog.set_windowState works, I do see the web dialog appear just like I did before. However, I don't seem to be tirggering the dialog.set_windowState event. My break point on the StateChanged line above never gets hit.
Hi Eric,
Autopostback happens only on action of user. If you call a member function of WebDialogWindow, then corresponding event on client and on server is not raised. Some member functions have extra flag, which allows to raise event (like on user action). Below is example for window state:
<script type="text/javascript">function showAndSubmit(){ var dialog = $find("WebDialogWindow1"); dialog.set_windowState($IG.DialogWindowState.Normal, true);}</script>
<ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="100px" WindowState="Hidden"onstatechanged="WebDialogWindow1_StateChanged" Width="300px" > <AutoPostBackFlags WindowStateChange="On"></AutoPostBackFlags></ig:WebDialogWindow><input id="Button1" type="button" value="ShowAndSubmit" onclick="showAndSubmit()" />
I thought I had it figured out, I saw that the Autopostback flag wasn't turned on for WindowStateChange, so I turned it on. Apparently that wasn't it, it's still not working.