The following LDL commands show some sample logic that can be used in Pre-Screen, Pre-Linc or Main logic to modify the presentation attributes of fields on a client form:
:Setup the name of the dynamic list for attribute processing MV; ISPEC GSD-LISTNAME ATT; (._ATTRIBUTES_) GSD-LISTNAME :Set the copy number for the field if it is in a Copy.From area MV; GLB.COPY GSD-COPY :Set the font of the specified field to Bold MV; (<Field Name 1>) GSD-FIELD-NAME MV; (BOLD) GSD-ATTRIBUTE SENDLIST.DYNAMIC; GSD-LISTNAME GSD-FIELD-ATTRIB :Hide the specified field MV; (<Field Name 2>) GSD-FIELD-NAME MV; (HIDE) GSD-ATTRIBUTE SENDLIST.DYNAMIC; GSD-LISTNAME GSD-FIELD-ATTRIB :Change the Background colour of the specified field MV; (<Field Name 3>) GSD-FIELD-NAME MV; (BACKCOLOR) GSD-ATTRIBUTE MV; (255,255,255) GSD-ATTR-PARAM1 SENDLIST.DYNAMIC; GSD-LISTNAME GSD-FIELD-ATTRIB
On the client side, each client uses the current ispec name and check for a list called “<ispecName>._ATTRIBUTES_”. If the list exists, then each list entry be read. The first column contains the field name, the second column contains the Copy.From number, and the third column contains the attribute to apply. For background and foreground colors, there is a fourth column with the color triplet to specify the required color in RBG format.
The following code example describes that the field attributes can be modified. In this example, the attribute of a field, MSG is modified. This field is part of an inserted class
ACTION_LINE and the attribute MSG can be modified by using a field name,
ACTION_LINE$ACTION_LINE$MSG. Also, a value is moved to the inserted field MSG.
Move ISPEC GSD_LISTNAME Attach "._ATTRIBUTES_" GSD_LISTNAME GSD_ATTRIBUTES := ":NAM:0:BOLD: " SendListDynamic GSD_LISTNAME GSD_ATTRIBUTES GSD_ATTRIBUTES := ":NAM:0:BACKCOLOR:255,0,0" SendListDynamic GSD_LISTNAME GSD_ATTRIBUTES GSD_ATTRIBUTES := ":NAM:0:FORECOLOR:0,0,255" SendListDynamic GSD_LISTNAME GSD_ATTRIBUTES GSD_ATTRIBUTES := ":SELLPRICE:0:BACKCOLOR:0,200,0" SendListDynamic GSD_LISTNAME GSD_ATTRIBUTES GSD_ATTRIBUTES := ":ACTION_LINE$ACTION_LINE$MSG:0:BACKCOLOR:255,255,0" SendListDynamic GSD_LISTNAME GSD_ATTRIBUTES Move "Test msg" ACTION_LINE.MSG
To create a reference to the dynamic presentation attribute, use the following declaration
of the field name ACTION_LINE$ACTION_LINE$MSG as defined in <ispec>IspecModel.java file:
public static final String ACTION_LINE$ACTION_LINE$MSG__TAG = "ACTION_LINE$ACTION_LINE$MSG"; private LINCStringField ACTION_LINE$ACTION_LINE$MSG;
If necessary, the client application also converts the field name to the control name according to the naming scheme imposed by that particular client type (for some clients, the control name might be different to the host application field name).
For fields that are not in a Copy.From region, the Copy.From number should be set to 0. If the Copy.From number is greater than 0, then the control name includes a Copy.From number, so that the correct control has the attribute applied to it. Note that the host application indexes Copy.From fields starting at 1, and the Component Enabler Clients will index them from 0 as a base. Therefore, if the value of Copy.From is greater than zero, the CE Client will need to use (Copy.From -1) as an index for the correct field to be highlighted.