Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Validating Field Content

...

Parameter values may contain unresolved references to IzPack variables, which are resolved at installation time.

Info

The <configuration> section including variable resolution is fully functional beginning from IzPack version 5.1.1.

Using Validators

Validators are bound to user input fields using the nested <validator> element;

...

You can implement your own custom Validator implementation simply by creating a new class which implements the com.izforge.izpack.panels.userinput.validator.Validator interface. This interface specifies a single method: validate(ProcessingClient) , which returns a boolean value. You can retrieve the value entered by the user by casting the input ProcessingClient for example in the RuleInputField and call the RuleInputField.getText() method. You can also retrieve any parameters to your custom Validator by calling theRuleInputField.getValidatorParams() which returns a java.util.Map object containing parameter names mapped to parameter values. For an example, take a look at com.izforge.izpack.util.RegularExpressionValidator.

...