Validation

From UG

Revision as of 19:18, 13 February 2010 by Alex (Talk | contribs)
Jump to: navigation, search


This relates to how / when we validate type/format.

Contents

Definition

Data validation is the process of ensuring that a program operates on clean, correct and useful data.

The simplest data validation verifies that the characters provided come from a valid set. For example, telephone numbers should include the digits and possibly the characters +, -, (, and ) (plus, minus, and parentheses). A more sophisticated data validation routine would check to see the user had entered a valid country code, i.e., that the number of digits entered matched the convention for the country or area specified.

(from http://en.wikipedia.org/wiki/Data_validation)

CT2 Validation Types

zk standard

Typical "real-time" ZK validation:

  • user enters incorrect value
  • user shifts focus to another field
  • (with some delay) bar will with "x" will appear next to widget stating what was wrong

on submit

Validate only after user clicked "Submit button". Standard Error modal or Warning modal will appear.

status line

There is a status line somewhere on the panel that real time displays the problem.

After Validation: what to do with data and what to tell the user

Next step after a validation is to make a decisions about:

  • what to do with data that fails validation?
  • how to communnicate with a user about it and what are the possible workflows

Normally validation is done before data is stored into database or into memory to be used later.

In CT2 there are several types of decisions:

  • ignore data
  • modify data so that it pass validation (example: cut the end of the string to satisfy max)
  • block the flow until user fixes the data


In all cases above you could:

  • say nothing to the user (bad idea)
  • display a message and give a choice
  • display a message and give no choice

See also CT2 Warning and CT2 Error

Another way of enforcing user to enter data in correct type / format: Blocking the Input

In CT2 and ZK there is another way of enforcing user to enter data in correct type / format.

For example if particular CT2 textbox should accept only integers then it can be programmed in such a way (defined as <intbox> ZK component) that if user is trying to enter characters then nothing happens - they simply do not appear on the screen.

Personal tools