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

        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.
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: