ICEfaces
  1. ICEfaces
  2. ICE-8907

Add "maxlength" attribute to ace:textAreaEntry

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces ace:textAreaEntry

      Description

      In order to provide a more convenient way to restrict the maximum length of the value of an ace:textAreaEntry a new "maxlength" attribute should be added.

      This attribute would optionally accept an integer value to specify the maximum number of characters that may be entered in this field.

        Activity

        Ken Fyten created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee yip.ng [ yip.ng ]
        Fix Version/s 3.3 [ 10370 ]
        Affects Documentation (User Guide, Ref. Guide, etc.) [ 10003 ]
        Assignee Priority P2 [ 10011 ]
        Hide
        Ken Fyten added a comment -

        The compat ice:inputTextarea comp. already has this feature for reference.

        Show
        Ken Fyten added a comment - The compat ice:inputTextarea comp. already has this feature for reference.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33210 Thu Jan 24 10:51:57 MST 2013 yip.ng ICE-8907: Add "maxlength" attribute to ace:textAreaEntry.
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textareaentry/TextAreaEntryMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/textareaentry/TextAreaEntryRenderer.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/textareaentry/textareaentry.js
        Hide
        yip.ng added a comment -

        Code in compat:

        Java:
        rendererJS.put(HTML.ONKEYDOWN_ATTR, handler);
        rendererJS.put(HTML.ONCHANGE_ATTR, handler);
        JS:
        if (maxlength >= 0 && field.value.length > maxlength)

        { field.value = field.value.substring(0, maxlength); }
        Show
        yip.ng added a comment - Code in compat: Java: rendererJS.put(HTML.ONKEYDOWN_ATTR, handler); rendererJS.put(HTML.ONCHANGE_ATTR, handler); JS: if (maxlength >= 0 && field.value.length > maxlength) { field.value = field.value.substring(0, maxlength); }
        Hide
        yip.ng added a comment -

        Done based on above, but using jQuery and keyup event. keydown will cause one-off problem because input character is not in value yet. Ditto keypress. (Then change event is not required? Not 100% sure. Kept it just in case.)

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\textareaentry\textareaentry.js#33210
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryMeta.java#33210
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#33210

        Show
        yip.ng added a comment - Done based on above, but using jQuery and keyup event. keydown will cause one-off problem because input character is not in value yet. Ditto keypress. (Then change event is not required? Not 100% sure. Kept it just in case.) M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\textareaentry\textareaentry.js#33210 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryMeta.java#33210 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\textareaentry\TextAreaEntryRenderer.java#33210
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            yip.ng
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: