Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Chris on Dec 12, 2009 07:08
open dhtmlx forum
ASP Controls inside window not firing events

I declare the following modal 'dialog' like so:

var dlg = dhxWins.createWindow("rulesDlg", 10, 10, 340, 180);

dlg.setText(mainToolbar.getItemToolTip(itemId));

dlg.denyResize();

dlg.denyPark();

dlg.button("close").hide();

dlg.button("park").hide();

dlg.button("stick").hide();

dlg.button("help").hide();

dlg.button("dock").hide();

dlg.button("minmax1").hide();

dlg.button("minmax2").hide();

document.getElementById("rulesContainer").style.display = "block";

dlg.attachObject("rulesContainer", true);

dlg.centerOnScreen();

dlg.setModal(true);

 

The 'rulesContainer' is declared as:

<div id="rulesContainer" style="display:none; width:340px; height:160px;" class="dhx_toolbar_text">

<asp:UpdatePanel ID="UpdatePanelRules" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">

<ContentTemplate>

<table>

<tr>

<td align="left">

<asp:RadioButtonList ID="SelectMode" runat="server" OnSelectedIndexChanged="SelectMode_SelectedIndexChanged"

AutoPostBack="True">

<asp:ListItem Value="0">Location Select Mode</asp:ListItem>

<asp:ListItem Value="1">Container Select Mode</asp:ListItem>

</asp:RadioButtonList>

</td>

</tr>

<tr>

<td align="left">

<asp:CheckBoxList ID="chkUnits" runat="server" AutoPostBack="True" OnSelectedIndexChanged="chkUnits_SelectedIndexChanged">

</asp:CheckBoxList>

</td>

</tr>

<tr>

<td>

<div align="center">

<asp:Button ID="btnCloseRulesDlg" runat="server" Text="Close" OnClick="btnCloseRulesDlg_Click"

OnClientClick="HideDlg('RulesDlg')" />

</div>

</td>

</tr>

</table>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTrigger ControlID="SelectMode" />

<asp:AsyncPostBackTrigger ControlID="chkUnits" />

</Triggers>

</asp:UpdatePanel>

</div>

The rulesContainer is not defined in a different .apsx page.

The expectation is that when the 'btnCloseRulesDialog' button is clicked, that the btnCloseRulesDlg_Click event will fire. This event is a server side event. Even when trying to do __doPostBack('btnCloseRulesDialog' ) it is not reaching the server.

 

Your help is appreciated.

 

Answer posted by Alex (support) on Dec 14, 2009 05:33

Hello,

you can try to place the content in a separate page and load this page into window iframe. Possibly this approach will solve the issue:

//dlg.attachObject("rulesContainer", true);

dlg.attachURL("content.apsx");

Where content "content.apsx":

...

<div id="rulesContainer" style="display:none; width:340px; height:160px;" class="dhx_toolbar_text">

...

</div>

...

Answer posted on Dec 14, 2009 07:33
Thanks you! This solution works great