[CLOSED] Numberfield / strange behavior

  1. #1

    [CLOSED] Numberfield / strange behavior

    Hello

    I just stumbled upon this - for me - strange behavior when I was debugging a change handler of a numberfield. On a change I just wanted to get the actual value in a simple alert box:

    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Test Case</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />    
    
    </head>
    <body>
        
        <form id="form" runat="server">
        <ext:ResourceManager runat="server" />
        
        <ext:NumberField runat="server" MinValue="0">
            <Listeners>
                <Change Handler="alert(this.getValue());" />
            </Listeners>
        </ext:NumberField>
        
        </form>
    </body>
    </html>
    In my browser (Chrome) the numberfield starts counting up after I close the alert box... going into an endless loop.

    Is that standard behavior? I expected to get per change from me a single alert box with the actual number. Or if it somehow gets another change from ext.net/ext.js at least another alert box but with the same number...

    Thanks for clearing up my confusion ;)

    best regards
    Last edited by Daniil; Sep 08, 2015 at 7:00 PM. Reason: [CLOSED]
  2. #2
    Hi @tMp,

    I could not reproduce it. but yes, issues are possible with an alert(''); call inside some of a field's events, because it takes a focus somewhere in the middle of a field's "life cycle".

    I would recommend to use console.log(...); instead of alert(...);.
  3. #3
    Hello Daniil,

    strange but thank you for the lesson. I will switch!

    best regards

Similar Threads

  1. Strange behavior after nuget
    By bovo13 in forum 2.x Help
    Replies: 7
    Last Post: Oct 17, 2013, 1:21 PM
  2. [CLOSED] RowExpander strange behavior
    By FAS in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 24, 2012, 7:37 PM
  3. Strange behavior of hidden compositeControl
    By Zdenek in forum 1.x Help
    Replies: 1
    Last Post: Dec 13, 2011, 5:31 AM
  4. Strange behavior with Window control
    By jlattimore in forum 1.x Help
    Replies: 1
    Last Post: May 30, 2011, 11:23 AM
  5. [CLOSED] Strange behavior of fieldset
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 20, 2010, 11:55 AM

Posting Permissions