Label/NumberField value not sent to codebehind

  1. #1

    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.

    <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.
  2. #2
    Hello guys, any hint on this?
  3. #3
    Hello, this reply I've just written might give you a background on what is happening.

    Just look at the same example in our v1 examples explorer!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. NumberField Suffix Label
    By 924170040 in forum 2.x Help
    Replies: 1
    Last Post: Aug 22, 2013, 2:22 AM
  2. [CLOSED] Label width ignored on NumberField
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 28, 2012, 5:05 AM
  3. How to change size of a label in a NumberField
    By extNewBee in forum 1.x Help
    Replies: 2
    Last Post: May 24, 2012, 12:20 PM
  4. setting Label cssStyle or color in codebehind
    By madhugumma in forum 1.x Help
    Replies: 0
    Last Post: Jun 19, 2009, 4:29 AM

Posting Permissions