iTP Active Transaction Pages (iTP ATP) Programmer's Guide

ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
4-26
atp.dictionary Object
Properties
name (read-only)
This property contains the value supplied to the constructor.
element (read-only)
This array contains one atp.field object for each DDL DEF that the
atp.dictionary object represents.
element.DEF properties (read-only):
These dynamically created properties of the element property are atp.field
objects, each representing one DDL DEF that the atp.dictionary object
represents. That is, for each DEF there is a property whose name consists of the
word “element,” followed by a period, followed by the name of the DEF.
atp.dictionary Object Usage Considerations
The constructor for the atp.dictionary object uses the DDL dictionary to build a
hierarchy of atp.field objects. This operation causes disk (or disk cache) activity,
which can affect application performance. Alternatively, applications can construct
atp.field objects directly; however the specification of atp.field object
constructors is tedious and error prone.
For convenience, you can use the dview example application program, described in
Appendix B, DDL Dictionary Viewer (dview)
, to generate atp.field object
constructors to be copied into your application. The generated constructors provide a
static definition of the DDL message within the JavaScript application.
Note that if you use dview to create constructors, updates to the DDL dictionary will
not automatically be reflected in your application. In contrast, the atp.dictionary
object continually accesses the DDL dictionary. The major advantage of static
atp.field object constructors is to improve performance by reducing DDL
dictionary-related disk activity.
To use the static atp.field object constructors, copy and paste them into the
JavaScript application. You can use a server-side include file to facilitate updates when
the DDL dictionary changes.
In addition to atp.field object constructors, the dview tool generates other
constructors that describe relationships among fields. For efficiency, use only the actual
atp.field object constructors (of the form new atp.field(....)) when you
invoke the atp.buffer setData(), getData(), and setBinary() methods.
For example:
myvar=mybuffer.getData(new atp.field('reply_code',2, 'Binary 16
unsigned',3,0,2,0,0,0,new Array(0,0,0,0,0,0,0),1));