Uploaded image for project: 'Click'
  1. Click
  2. CLK-46

Regular expression based validation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • core
    • None

    Description

      Now, TextField supports length and required validation.
      In addition, Click provides some components which extended TextField such as EmailField, CreditField.
      But when I need other format validation, I must make new extended field components.

      I think the component which supports regexp based validation is useful.
      So I made this as new component named PatternField.

      ========
      PatternField field = new PatternField("java");
      field.setPattern(".+
      .java");
      ========

      To use this component, you have to add message entry to click-control.properties like following:

      ========
      field-pattern-error=

      {0}

      format must be

      {1}

      ========

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            takezoe Naoki Takezoe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: