You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org> on 2009/02/17 13:49:02 UTC

[jira] Commented: (TRINIDAD-1390) maximumLength generates onKeyUp JavaScript even if value is <= 0

    [ https://issues.apache.org/jira/browse/TRINIDAD-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674198#action_12674198 ] 

Matthias Weßendorf commented on TRINIDAD-1390:
----------------------------------------------

  @Override
  protected String getOnkeyup(
    FacesBean bean
    )
  {
    String onKeyUp = super.getOnkeyup(bean);
    if (isTextArea(bean))
    {
      Number maximumLength = getMaximumLength(bean);
      if(maximumLength != null && maximumLength.intValue()> 0)
      {
        onKeyUp = _getMaxLengthFunction(onKeyUp,
                                        maximumLength.intValue());
      }
    }

    return onKeyUp;
  }

> maximumLength generates onKeyUp JavaScript even if value is <= 0
> ----------------------------------------------------------------
>
>                 Key: TRINIDAD-1390
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1390
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.10-core
>         Environment: Facelets 1.1.14, MyFaces core 1.2.4, Glassfish v2
>            Reporter: Bart Kummel
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When "columns" is set to a value > 1 on an tr:inputText, a textarea is rendered instead of an ordinary input. Since a textarea doesn't support the "maxlength" attribute, a JavaScript function is used to force the maximum input length if the "maximumLength" attrinute is used on the component. The value of "maximumLength" is used as a parameter for the JavaScript function. If this value is <= 0, this means no text can be typed in the textarea, the JavaScript function will prevent this. But according to the documentation, setting "maximumLength" to a value <= 0 should disable maximum length checking. If the "maximumLength" is not set at all, no JavaScript function call is added to the textarea. This should also happen if the value of "maximumLength" <= 0.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.