EGL Reference Guide for iSeries
You may want your program to do a task regardless of whether the user
modified a particular field; for example:
- You may want to force the validation of a password field even if the user
did not enter data into that field
- You may specify a validation function for a critical field (even for a
protected field) so that the program always does a particular cross-field
validation, which means that your program logic validates a group of
fields and considers how one field's value affects the validity of
another.
To handle the previous cases, you can set the modified property
for a particular item either in your program logic or in the form
declaration:
- In the logic that precedes the form presentation, include a statement of
the type set item modified. The result is that when the form
is presented, the modified data tag for the item is pre-set to
yes.
- In the form declaration, set the modified property
of the item to yes. In this case, the following rules
apply:
- When the form is presented for the first time, the modified data tag for
the item is pre-set to yes.
- If any of the following situations occurs before the form is presented,
the modified data tag is pre-set to yes when the form is
presented:
- The code runs a statement of the type set item initial, which
reassigns the original content and property values for the item; or
- The code runs a statement of the type set item
initialAttributes, which reassigns the original property values (but not
content) for each item on the form; or
- The code runs a statement of the type set form initial, which
reassigns the original content and property values for each item on the
form; or
- The code runs a statement of the type set form
initialAttributes, which reassigns the original property values (but not
content) for each item on the form
The set statements affect the value of the modified
property, not the current setting of the modified data tag. A test of
the type if item modified is based on the modified data tag value
that was in effect when the form data was last returned to your
program. If you try to test the modified data tag for an item before
your logic presents the form for the first time, an error occurs at
run time.
If you need to detect whether the user (rather than the program) modified
an item, make sure that the value of the modified data tag for the item is
pre-set to no:
- If the modified property of the item is set to no in
the form declaration, do not use a statement of the type set item
modified. In the absence of that statement, the modified
property is automatically set to no prior to each form
presentation.
- If the modified property of the item is set to yes in
the form declaration, use a statement of the type set item normal
in the logic that precedes form presentation. That statement sets the
modified property to no and (as a secondary result)
presents the item as unprotected, with normal intensity.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.