|
Jakarta
Commons Integration. The Apache Software Foundation has
a excellent XML definition for verifying user input. NotWired extends
and integrates QForms, an excellent Javascript validation library,
with JSP and Java libraries to provide a very powerful declarative
validation using the standard validation.xml definition. Furthermore,
additional rules may be declared within the validation.xml file to
control dynamic validations and components on a page.
Click here for a sample XML definition.
|
|
Conditional Rules |
|
DisableOnConditionRule.
Disables a set of fields based on a condition. This rule
is used on the initial load of a page when no events have occurred
to trigger the EnableDisableOnConditionRule.
Both rules are used in conjunction. See also DisableRule.
|
|
EnableDisableOnConditionRule.
Enables or disables a set of fields
based on a condition. Disabled fields automatically disable associated
validation and rules. Fields are identified by name that corresponds
to the form.
|
|
EnableDisableArrayOnConditionRule.
Same as above except this rule
acts on fields that are represented as an array. For example, three
radio buttons all with the same field name are identified in Javascript
as field[0], field[1] and field[2]. The rule controls array fields.
|
|
MultipleConditionExpressionRule. Evaluates
multiple conditions and executes true or false logic based on a
condition. For example, two conditions are available. They are age
> 25 and gender
is male. A new rule would
be defined as such:
if(age > 25 &&
gender is male) {
enable a set of screen components;
} else {
// basic scripting
disable a set of screen components;
forward to another JSP;
}
Developers
may setup two conditions and add the rule decoratively in the validation.xml
or dynamically in the controller.
|
|
EnableRuleOnConditionRule.
Enables a rule based on a condition being met. Set this rule
on a field that should trigger other rules based on a changing field
state.
|
|
Data Entry Validation Rules |
|
ABANumberValidationRule.
Validates the number entered is
a valid ABA. This rule is used in conjunction with a MaskedEntryTag
to verify nine (9) digits are entered and the pattern is valid.
|
|
DateValidationRule. Validate
the date entered is a valid date. Generally, applying a MaskedEntryTag
to a field will make this validation rule redundant.
|
|
EmailAddressValidationRule.
Validates if a field entry is a valid email address.
|
|
EmailAddressListValidationRule
Validates email address is a comma delimited list.
|
|
DependencyValidationRule.
Makes a field required and dependent on the entry of data
into another field. For example, a user enters the first line of an
address. Using the DependencyValidationRule allows a developer to
require city, state and zip fields when some value is entered in the
address field.
|
|
MinLengthValidationRule.
Sets a minimum data entry length on a field.
|
|
TypeValidationRule. Enforces
type checking on a data entry field. For example, numeric, alpha,
alphanumeric, decimal, etc.
|
|
ExpressionValidationRule.
Evaluates a general Javascript expression against a field
value. If the expression fails, the validation fails.
|
|
RegExpValidationRule. Evaluates
a regular expression against a field. If the regular expression fails,
the validation fails.
|
|
GreaterThanOrEqualToValidationRule.
Checks to see if a field is greater than or equal in value
to some limit.
|
|
LessThanOrEqualToValidationRule.
Checks to see if a field is less than or equal to some limit.
|
|
FixedSizeValidationRule.
Checks to see if a field is a set fixed size.
|
|
RangeValidationRule. Checks
to make sure field is in a range.
|
|
SameValueValidationRule.
Checks to make sure one field value is a the same value as
another field value.
|
|
URLValidationRule. Checks
to make sure a field is a valid URL.
|
|
SelectionToFieldBindingValidationRule.
Enforces a validation of a target field based on the selected
value in a selection list.
|
|
Field Control Rules |
|
DisableRule. Disables
a field on the page when page is loaded. This rule is generally applied
dynamically based on the state of data when entering a page.
|
|
FieldDescriptionRule. Sets
the description information on the field. Utilizing this action will
override settings from the validation.xml <msg/> tag.
|
|
Supporting Structures |
|
FieldCondition. A
condition will generate javascirpt that will be evaluated by other
rules during screen rendering and validation. |