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

Regular expression based validation

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: