Nov 16, 2015, 1:39 PM
Label/NumberField value not sent to codebehind
Hello,
I have a problem: When a clientside listener is fired, text in labels and numberfields isn't being sent to codebehind.
How can I get those values to be passed to codebehind?
Thanks for your time
Regards
Alex
I have a problem: When a clientside listener is fired, text in labels and numberfields isn't being sent to codebehind.
<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
function CambioCantidad(sender, eventArgs) {
#{DirectMethods}.CambioCantidad(#{lblValor}.Text, #{nfCantidad}.getValue(), #{txtEfectivo}.getValue());
};
</script>
</ext:XScript>
...
<ext:Label ID="lblValor" Font-Size="12" Font-Bold="true" runat="server" Text="" Width="100px" />
<ext:NumberField ID="nfCantidad" runat="server" Cls="AlinacionDerecha" Font-Size="Medium" AllowDecimals="false" AllowBlank="false"
SelectOnFocus="true" BlankText="Indique cantidad" Width="100px" Disabled="true" MaxLength="2">
<Listeners>
<Blur Fn="CambioCantidad" />
</Listeners>
</ext:NumberField>
<ext:NumberField ID="txtEfectivo" Font-Size="medium" AllowDecimals="true" Font-Bold="true" runat="server" Width="100px"
DecimalPrecision="2" DecimalSeparator="." Disabled="true" Cls="AlinacionDerecha" BlankText="Indique valor">
<Listeners>
<Blur Fn="CambioCantidad"/>
</Listeners>
</ext:NumberField>
...
In the code above, when lblValor lose focus, listener CambioCantidad is fired, and it calls a DirectMethod in codebehind, but value of #{lblValor}.Text is empty. txtEfectivo.getValue() or nfCantidad.getValue() are also empty depending on which control fired the listener.How can I get those values to be passed to codebehind?
Thanks for your time
Regards
Alex
Last edited by aluna; Nov 16, 2015 at 2:49 PM.