Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2341

Can't specify a regexp validator with a comma

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Won't Fix
    • 5.3.7
    • None
    • tapestry-core
    • None

    Description

      Trying to validate a two decimal numeric input with"

                  <t:textfield t:id="erpfte" class="input-mini" value="quota.erp"
                               translate="prop:twoDecimal" validate="regexp=^\d+(?:\.\d{1,2})?$" />
      

      Generates this partial stack trace:

      Caused by: java.lang.RuntimeException: Unexpected character '2' at position 22 of input string: regexp=^\d+(?:\.\d{1,2})?$
      	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.parseError(FieldValidatorSourceImpl.java:423)
      	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.parse(FieldValidatorSourceImpl.java:315)
      	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.toValidatorSpecifications(FieldValidatorSourceImpl.java:200)
      	at org.apache.tapestry5.internal.services.FieldValidatorSourceImpl.createValidators(FieldValidatorSourceImpl.java:183)
      

      Looking through the code, it appears the parser thinks the comma ends the current validator and is starting another.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hhubris Tony Nelson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: