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
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()" />
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.
I can not explain why it does not work for you. I tried your codes (aspx.vb instead of cs) and it worked same way as for cs. The break point on server was hit.
Please add to your site a temporary cs page and test exact codes (copy-paste), which I sent you before. I hope it will work. After that try to figure why your original page does not work. Do not forget to include AutoPostaBackFlags.
Add one more person hitting same issue; event StateChanged never seems to get raised.
Hi viktors
I am also facing the same problem, I am coding on c# only for me state change event is not at all firing , Can you please suggest what I have to do now, I am here by specifying my code too
<ig:WebDialogWindow ID="dialogMap" runat="server" Height="400px" Width="400px" InitialLocation="Centered" Modal="True" MaintainLocationOnScroll="True" onStateChanged="dialogMap_StateChanged" WindowState="Hidden"><AutoPostBackFlags WindowStateChange="On"></AutoPostBackFlags><ContentPane><Template></Template></ContentPane></ig:WebDialogWindow>
<
input type="button"style="border-style:ridge;background: url('../images/down.ico') no-repeat; margin-top: 0px; width: 31px;height: 30px;"onclick="browse.click();file.value=browse.value;" title="Import" onfocus="TrigButton('<%= dialogMap.ClientID %>' );"value="" />
protected void dialogMap_StateChanged(object sender, Infragistics.Web.UI.LayoutControls.DialogWindowStateChangedEventArgs e)
{ ddlImport.DatSource == something;
}
My machine has latest version (higher than next hot fix). Though, that particular behavior should not depend on that, because "fireEvent" flag was available since the very first version of control.
I'll try your suggestion.
What version of the infragistics control are you using? I'm using 8.2.20082.1000