ICEfaces
  1. ICEfaces
  2. ICE-3458

Add maxlength attribute to inputTextarea

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.8.1
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Use Javascript to replicate similar behavior

      JavaScript:
           <script language="javascript">
                      function textCounter(field,maxlimit) {
                          if (field.value.length > maxlimit)
                              field.value = field.value.substring(0, maxlimit);
                          
                      }
           </script>

      Component:

      <ice:inputTextarea id="text"
                                         cols="50"
                                         rows="3"
                                         value="#{testBean.text}"
                                         onkeydown="textCounter(this, 20)"/>
      Show
      Use Javascript to replicate similar behavior JavaScript:      <script language="javascript">                 function textCounter(field,maxlimit) {                     if (field.value.length > maxlimit)                         field.value = field.value.substring(0, maxlimit);                                      }      </script> Component: <ice:inputTextarea id="text"                                    cols="50"                                    rows="3"                                    value="#{testBean.text}"                                    onkeydown="textCounter(this, 20)"/>

      Description

      The inputText component has a maxlength attribute which will limit the characters in the component. There has been a request for this feature to be added onto the inputTextarea component.

        Issue Links

          Activity

          Arran Mccullough created issue -
          Arran Mccullough made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Minor [ 4 ]
          Support Customer Ref. #s https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=5139
          Arran Mccullough made changes -
          Workaround Description Use Javascript to replicate similar behavior

          JavaScript:
               <script language="javascript">
                          function textCounter(field,maxlimit) {
                              if (field.value.length > maxlimit)
                                  field.value = field.value.substring(0, maxlimit);
                              
                          }
               </script>

          Component:

          <ice:inputTextarea id="text"
                                             cols="50"
                                             rows="3"
                                             value="#{testBean.text}"
                                             onkeydown="textCounter(this, 20)"/>
          Workaround Exists [Yes]
          Arran Mccullough made changes -
          Salesforce Case [50070000008Jidz]
          Ken Fyten made changes -
          Fix Version/s 1.8.1 [ 10170 ]
          Ken Fyten made changes -
          Assignee Priority P1
          Assignee Mark Collette [ mark.collette ]
          Mark Collette made changes -
          Link This issue depends on ICE-4455 [ ICE-4455 ]
          Mark Collette made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Priority P1
          Mark Collette made changes -
          Link This issue blocks ICE-5343 [ ICE-5343 ]

            People

            • Assignee:
              Mark Collette
              Reporter:
              Arran Mccullough
            • Votes:
              11 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: