ICEfaces
  1. ICEfaces
  2. ICE-4032

Add maxlength attribute to selectInputDate

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2 SP1
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      JavaScript:
      <script type="text/javascript">
      function chklen() {
      var un = document.getElementById("form1:date").value
      var len = un.length;
      if (len > 9) {
      alert ("Too many characters in date field!");
      document.getElementById("form1:date").value = un.substring(0,9); // remove excess characters
      return false;
      }
      }

      </script>

      JSPX:
      <ice:form id="form1">
      <ice:selectInputDate id="date" renderAsPopup="true"
      value="#{testBean.date}"
      partialSubmit="true"
      onkeypress="chklen();">
      <f:convertDateTime timeZone="#{testBean.timeZone}"
      pattern="MM/dd/yyyy"/>
      </ice:selectInputDate>
      <ice:messages/>
      </ice:form>
      Show
      JavaScript: <script type="text/javascript"> function chklen() { var un = document.getElementById("form1:date").value var len = un.length; if (len > 9) { alert ("Too many characters in date field!"); document.getElementById("form1:date").value = un.substring(0,9); // remove excess characters return false; } } </script> JSPX: <ice:form id="form1"> <ice:selectInputDate id="date" renderAsPopup="true" value="#{testBean.date}" partialSubmit="true" onkeypress="chklen();"> <f:convertDateTime timeZone="#{testBean.timeZone}" pattern="MM/dd/yyyy"/> </ice:selectInputDate> <ice:messages/> </ice:form>

      Description

      Feature Request: It may be helpful to have an easy way to set a max length for input into the textbox of the selectInputDate component.

        Activity

        Hide
        yip.ng added a comment -

        Ken: Might as well do it now for both EE 1.8.2 P07 and 3.3.

        Show
        yip.ng added a comment - Ken: Might as well do it now for both EE 1.8.2 P07 and 3.3.
        Hide
        yip.ng added a comment -

        Done.

        M: \icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml#33925
        M: \icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java#33925

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\compat\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml#33928
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\compat\components\src\main\java\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java#33928

        Show
        yip.ng added a comment - Done. M: \icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml#33925 M: \icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java#33925 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\compat\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml#33928 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\compat\components\src\main\java\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java#33928

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: