MyFaces Commons
  1. MyFaces Commons
  2. MFCOMMONS-26

validateRegExpr doesnt support value binding in patter property

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1
    • Labels:
      None

      Description

      As from version 1.1.7 validateRegExpr tag desn't support value binding in pattern field.

      ValidateRegExprTag.java
      Version 1.1.6 has:
      protected Validator createValidator() throws JspException {

      FacesContext facesContext = FacesContext.getCurrentInstance();
      setValidatorId(RegExprValidator.VALIDATOR_ID);
      RegExprValidator validator = (RegExprValidator)super.createValidator();
      if (_pattern != null)
      {
      if (UIComponentTag.isValueReference(_pattern))

      { ValueBinding vb = facesContext.getApplication().createValueBinding(_pattern); validator.setPattern(new String(vb.getValue(facesContext).toString())); }

      else

      { validator.setPattern(_pattern); }

      }

      return validator;
      }

      Version 1.1.7 has:
      protected Validator createValidator() throws JspException {

      FacesContext facesContext = FacesContext.getCurrentInstance();
      setValidatorId("org.apache.myfaces.validator.RegExpr");
      org.apache.myfaces.custom.regexprvalidator.RegExprValidator validator = (org.apache.myfaces.custom.regexprvalidator.RegExprValidator)super.createValidator();
      if (_pattern != null)

      { validator.setPattern(_pattern); }

      return validator;
      }

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        720d 2h 32m 1 Leonardo Uribe 23/Nov/10 18:49
        Resolved Resolved Closed Closed
        15d 6h 50m 1 Leonardo Uribe 09/Dec/10 01:39
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.0.1 [ 12315967 ]
        Fix Version/s 1.0.1-SNAPSHOT [ 12313539 ]
        Leonardo Uribe made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 1.0.1-SNAPSHOT [ 12313539 ]
        Resolution Fixed [ 1 ]
        Hide
        Leonardo Uribe added a comment -

        Added patternExpression property.

        Show
        Leonardo Uribe added a comment - Added patternExpression property.
        Leonardo Uribe made changes -
        Field Original Value New Value
        Project MyFaces Tomahawk [ 12310272 ] MyFaces Commons [ 12310846 ]
        Key TOMAHAWK-1377 MFCOMMONS-26
        Affects Version/s 1.1.7 [ 12313398 ]
        Component/s myfaces-commons-validators [ 12312560 ]
        Component/s Validators [ 12310769 ]
        Hide
        Leonardo Uribe added a comment -

        rev 668968, fields that read regular expressions like pattern should be literalOnly, in other words does not read ValueExpressions, because some regular expressions are not readed correctly if ValueExpression is activated.

        Show
        Leonardo Uribe added a comment - rev 668968, fields that read regular expressions like pattern should be literalOnly, in other words does not read ValueExpressions, because some regular expressions are not readed correctly if ValueExpression is activated.
        Tomasz Bech created issue -

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Tomasz Bech
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development