beautypg.com

Events for the fieldtype object, Onfieldactivated, Onfieldchanged – Kofax DOKuStar Validation User Manual

Page 41: Onfielddeactivated

background image

DOKuStar Validation Programming Manual

Page

37

Events for the FieldType Object

OnFieldActivated

This event will be fired when a field gets activated, either by keyboard entry, mouse click or by the scripting code
itself.

Definition:

Private Sub fld_OnFieldActivated(ByVal Field As Field, ByVal PreviousField As Field)

The parameter

Field

is the field that gets activated,

PreviousField

is the field that gets deactivated.

When you return

False

in the

OnFieldActivating,

always the next field will be activated automatically.

OnFieldChanged

This event will be fired when the contents of a field changed. This happens when the user enters data, but also when
a field’s value is changed by another scripting routine. Be aware of this to avoid cycles in the code!

Definition:

Private Sub fld_OnFieldChanged(ByVal Field As Field, ByVal SubField As Field)

The parameter

Field

is the field itself.

SubField

may point to a sub-field of the

Field

; e.g. a cell of a table is a

sub-field of the table field. For more information, see chapter TableFields below.

The event will only be fired if the data really changes; if the user just steps through the fields without changes, the
event will not be triggered.

If you return

False

in the

OnFieldChanging

event, the old contents of the field (before the user did any typing)

will be restored. See the “How Do I…” section on how to change this behaviour.

Field.Value always contains what the user typed in. The original contents of the field can be seen in the

OnFieldChanging

event in the additional

VerifyEventArgs

parameter.

OnFieldDeactivated

These events will be fired when the field was deactivated. If the

OnFieldDeactivating

event is aborted, the

current field will remain active.

Definition:

Private Sub fld_OnFieldDeactivated(ByVal Field As Field, ByVal NextField As Field)

The parameter

Field

is the field that becomes deactivated, where

NextField

is the field that will become

activated.

Note that the old field contents will not be restored when the

OnFieldDeactivating

event is aborted! The

OnFieldDeactivating

event occurs after the

OnFieldChanged

event, so the changing of the value has

already taken place and cannot be taken back (see Event Order below).