Nov 04, 2010, 1:28 PM
[CLOSED] Read Only NumberField
I'm having trouble reading the current value of a NumberField set to readonly=true. I'm updating the number in the field with a button and direct event and then showing the results in an alert. When I click the Show button, I get the default value and not the value in the field. If the NumberField is set to readonly=false, it works fine. Please let me know if I'm missing something...code sample follows.
Thank you.
Thank you.
<head runat="server">
<title></title>
<script runat="server" >
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As AjaxEventArgs)
ScriptManager1.AddScript("Ext.Msg.alert('Alert', '" & numNet.Number & "');")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As AjaxEventArgs)
numNet.Number = 5.12
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:NumberField ID="numNet" runat="server" FieldLabel="Net" Width="100" AllowDecimals="true" TrimTrailedZeros="False" ReadOnly="True" />
<ext:Button ID="Button1" runat="server" Text="Show">
<AjaxEvents>
<Click OnEvent="Button1_Click" />
</AjaxEvents>
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Set Number">
<AjaxEvents>
<Click OnEvent="Button2_Click" />
</AjaxEvents>
</ext:Button>
</div>
</form>
</body>
Last edited by Daniil; Nov 04, 2010 at 8:51 PM.
Reason: [CLOSED]