[FIXED] [V0.8.2] TextArea bug when MaxLength property set

  1. #1

    [FIXED] [V0.8.2] TextArea bug when MaxLength property set

    I'm using version 0.8.1.19577 of Coolite. When I try to set the "MaxLength" property of the TextArea, the control turns in to a single-line TextField.

    E.g. When using the following, the TextArea is multi-line:

    <ext:TextArea ID="TextArea1" runat="server" Height="200"></ext:TextArea>
    But as soon as the MaxLength property is set, the TextArea turns in to a single-line TextField:

    <ext:TextArea ID="TextArea1" MaxLength="2000" runat="server" Height="200"></ext:TextArea>
  2. #2

    RE: [FIXED] [V0.8.2] TextArea bug when MaxLength property set

    Yes, I was able to reproduce the issue. I'm working on a fix.

    Geoffrey McGill
    Founder
  3. #3

    RE: [FIXED] [V0.8.2] TextArea bug when MaxLength property set

    ok, I was able to find a work-around, althougn not ideal.

    The html <textarea> element does not have a "maxlength" attribute like the <input>, so we had to work-around the problem by tapping into the <ext:TextArea>'s <Invalid> Listener which fires during key events.


    If the the MaxLength property has been set, an Invalid Listener will be created which automatically truncates the value of the TextArea.


    The fix has been committed to svn and will be publicly available with v0.8.2 for those without access to svn.


    Hope this helps. Thanks for reporting the defect.


    Geoffrey McGill
    Founder
  4. #4

    RE: [FIXED] [V0.8.2] TextArea bug when MaxLength property set

    Is there some workaround to fix this issue without updating from svn? Where already in the testing stage and people won't be happy to change the coolite.dll. :(
  5. #5

    RE: [FIXED] [V0.8.2] TextArea bug when MaxLength property set

    The following should work with <V0.8.2.

    Example

    <ext:TextArea ID="TextArea1" runat="server" MaxLength="2000" Height="200">
        <Listeners>
            <Invalid Handler="el.setValue(el.getValue().substr(0, el.maxLength));" />
        </Listeners>
    </ext:TextArea>
    Hope this helps.
    Last edited by geoffrey.mcgill; Nov 11, 2010 at 6:26 PM.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] MaxLength Property
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 26, 2012, 2:14 PM
  2. [CLOSED] TextArea : MaxLength not working
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 11, 2010, 7:00 PM
  3. [CLOSED] Textarea maxlength
    By bethc in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 23, 2009, 3:02 PM
  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

Posting Permissions