PDA

View Full Version : [CLOSED] Checkbox Checked value in DirectMethod



CarWise
Dec 20, 2013, 10:31 AM
Hi guys,

Can you explain to me why this works opposite from what i expected ? Could not find another event to use. Dirty change event works as expected, but only once ..



<%@ Page Language="C#" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html>
<script runat="server">
[DirectMethod]
public void showValue()
{
X.Msg.Alert("Status", String.Format("Value change event checkbox = {0}",chbDelete.Checked)).Show();
}
</script>
<html>
<head id="Head1" runat="server">
<title>Checkbox</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:FormPanel ID="fpQuery" runat="server">
<Items>
<ext:Checkbox runat="server" ID="chbDelete" FieldLabel="Click here !">
<Listeners>
<%--<DirtyChange Handler="App.direct.showValue()"/>-->
<Change Handler="App.direct.showValue();"/>
</Listeners>
</ext:Checkbox>
</Items>
</ext:FormPanel>
</form>
</body>
</html>

Daniil
Dec 20, 2013, 11:01 AM
Hi Martin,

We also listen to a Checkbox's Change event to update its hidden field containing a value to submit. So, your Change listener executes before our one.

To fix it, you could set up a Delay:

<Change Handler="App.direct.showValue();" Delay="1" />

CarWise
Dec 20, 2013, 1:29 PM
Hi Martin,

We also listen to a Checkbox's Change event to update its hidden field containing a value to submit. So, your Change listener executes before our one.

To fix it, you could set up a Delay:

<Change Handler="App.direct.showValue();" Delay="1" />

Thanks Daniil..

that did the trick.

If I don't speak you again...Merry Xmas to you all !

Martin

Daniil
Dec 20, 2013, 4:20 PM
Thank you, Martin! Merry X-mas to you as well!

As for the issue, we are considering it a defect. A developer should not be supposed to set up a Delay in such a scenario. We are investigating a possible fix.

Daniil
Dec 25, 2013, 10:17 AM
It has been fixed in the SVN trunk. Thank you for bringing that to us!