[CLOSED] NumberField SpinUp/down MaxLength

  1. #1

    [CLOSED] NumberField SpinUp/down MaxLength

    Hi,

    SpinUp or SpinDown of NumberField doesn't respect MaxLength Value.

    If I have this code:
    <ext:NumberField ID="txtValor" runat="server" FieldLabel="<%$ AppRecursos : sm_txt_valor %>"
                        Width="140" Hidden="true" LabelAlign="Top" EnforceMaxLength="true" MaxLength="15" />
    When you type "999999999999999" and spin up the new value is 999999999999999 + 1 and new value maxLength is 16.

    But if I put this code:
    <ext:NumberField ID="txtValor" runat="server" FieldLabel="<%$ AppRecursos : sm_txt_valor %>"
                        Width="140" Hidden="true" LabelAlign="Top" EnforceMaxLength="true" MaxLength="15" MaxValue="999999999999999" />
    Works right.

    I think this is a bug.
    Last edited by Daniil; Dec 27, 2012 at 9:00 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I would not consider it a bug according the docs.

    The MaxLength property deals with validation only.
    http://docs.sencha.com/ext-js/4-1/#!...-cfg-maxLength

    The EnforceMaxLength property just sets up the maxLength attribute for the input HTML element which can't manage the scenario you described.
    http://docs.sencha.com/ext-js/4-1/#!...forceMaxLength

    So, I think that setting up the MaxValue is an appropriate solution.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I would not consider it a bug according the docs.

    The MaxLength property deals with validation only.
    http://docs.sencha.com/ext-js/4-1/#!...-cfg-maxLength

    The EnforceMaxLength property just sets up the maxLength attribute for the input HTML element which can't manage the scenario you described.
    http://docs.sencha.com/ext-js/4-1/#!...forceMaxLength

    So, I think that setting up the MaxValue is an appropriate solution.
    Ok, for me is a bug because in docs says this about maxLength.
    "...provide instant feedback to the user by improving usability to allow pasting and editing or overtyping and back tracking..."

    http://docs.sencha.com/ext-js/4-1/#!...-cfg-maxLength

    And spinup allows user to see more numbers than allowed maxLength.

    I would solve it with minValue and maxValue, but is more simple to resolve in spinup/spindown methods in numberfield.
  4. #4
    Quote Originally Posted by softmachine2011 View Post
    "...provide instant feedback to the user by improving usability to allow pasting and editing or overtyping and back tracking..."
    Well, it doesn't say that it will restrict the maximum number of characters. It means that a validation error will be shown.

    So, personally, I would not consider it a bug. But I understand that many developers/users (and I as well) would expect the behavior that you want. Maybe a feature request.

    I have reported it to Sencha.
    http://www.sencha.com/forum/showthread.php?229687

    Lets wait what they will answer.
  5. #5
    Ok thanks, I'll be waiting for their answer
  6. #6
    Sencha has opened a bug ticket. I will monitor.
  7. #7
    I will wait for a response.
  8. #8
    It appears to be fixed in the trunk.

Similar Threads

  1. issue about maxlength of TextField
    By sonnh11 in forum 1.x Help
    Replies: 4
    Last Post: Jan 07, 2013, 6:33 AM
  2. HtmlEditor MaxLength
    By walle in forum 1.x Help
    Replies: 2
    Last Post: Jun 22, 2010, 5:58 AM
  3. change textfield maxlength
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Sep 24, 2009, 4:51 AM
  4. [CLOSED] MaxLength fix for TextArea
    By jsemple in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 09, 2009, 5:49 PM
  5. Set the MaxLength For TextArea control
    By Dinesh.T in forum 1.x Help
    Replies: 1
    Last Post: May 30, 2009, 2:08 AM

Tags for this Thread

Posting Permissions