You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Bart Kummel (JIRA)" <de...@myfaces.apache.org> on 2009/02/09 16:01:00 UTC

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

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


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.


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

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ 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.


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

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674204#action_12674204 ] 

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

and

  @Override
  protected String getOnchange(
    FacesBean bean
    )
  {
    String onchange = super.getOnchange(bean);
    if (isAutoSubmit(bean))
    {
      RenderingContext arc = RenderingContext.getCurrentInstance();
      String source = LabelAndMessageRenderer.__getCachedClientId(arc);
      boolean immediate = isImmediate(bean);
      String auto = AutoSubmitUtils.getSubmitScript(arc, source, XhtmlConstants.AUTOSUBMIT_EVENT, immediate);
      if (onchange == null)
        onchange = auto;
      else if (auto != null)
        onchange = XhtmlUtils.getChainedJS(onchange, auto, true);
    }

    if (isTextArea(bean))
    {
      Number maxLength = getMaximumLength(bean);
      if (maxLength != null && maxLength.intValue()> 0)
      {
        onchange = _getMaxLengthFunction(onchange,
                                         maxLength.intValue());
      }
    }

    return onchange;
  }

> 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
>            Assignee: Matthias Weßendorf
>   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.


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

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1390.
------------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.11-core

> 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
>            Assignee: Matthias Weßendorf
>             Fix For:  1.2.11-core
>
>   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.