When a panel is displayed by the TBDISPL service, the model lines
in the )MODEL section are duplicated at the end of the logical screen. When the scrollable
portion of the screen is being formatted, only full units or duplications
of these model lines are usually displayed. Two exceptions are:
- When the command line is repositioned to the bottom of the screen,
the line above it, which can be a model line, may be overlaid with
a blank line and used as the long message line. This prevents table
display data from being overlaid with long message data.
- When the PFSHOW command is in effect, up to four additional lines
can be overlaid.
Each input or output field that has a corresponding column in the
table is initialized with data from succeeding rows from the table.
The first row displayed is the row pointed to by the CRP when TBDISPL
was issued.
Input or output fields in a model line that do not correspond to
columns in the table are initialized, in all rows, with the current
contents of the corresponding dialog variables. If these fields are
to be blank, the corresponding variables must be set to blanks or
null before each call of TBDISPL. The CLEAR keyword can be used to
specify that they are to be blanked.
A user can scroll the data up and down. Scroll commands, such as DOWN
5, apply to the number of table entries to scroll up or down.
For example, if three model lines are specified, DOWN 5 would
scroll by 5 table entries, which corresponds to 15 lines on the display.
A user can enter information in any of the input fields within
the fixed or scrollable portion of the panel.
Figure 1 shows a sample panel definition
for table display.
Figure 1. Table display panel definition)ATTR
@ TYPE(OUTPUT) INTENS(LOW)
)BODY
%---------------------------- EMPLOYEE LIST ---------------------------------
%COMMAND INPUT ===>_ZCMD %SCROLL ===>_AMT +
+
%EMPLOYEES IN DEPARTMENT@Z +
+
+SELECT ------ EMPLOYEE NAME ------- -- PHONE --- EMPLOYEE
+ CODE LAST FIRST MI AREA NUMBER SERIAL
)MODEL
_Z+ @LNAME @FNAME @I @PHA @PHNUM @EMPSER
)INIT
.ZVARS = '(DEPT SELECT)'
&AMT = PAGE
.HELP = PERS123
)REINIT
IF (.MSG = ' ')
&SELECT = ' '
REFRESH (SELECT)
)PROC
IF (&ZTDSELS ¬= 0000)
VER (&SELECT, LIST, A, D, U)
)END
Assuming that the current contents of the table are as shown in Table 1 and that dialog variable DEPT contains
'27', the resulting display is shown in Figure 2.
Table 1. Table display
dataEMPSER |
LNAME |
FNAME |
I |
PHA |
PHNUM |
---|
598304 |
Robertson |
Richard |
P |
301 |
840-1224 |
172397 |
Smith |
Susan |
A |
301 |
547-8465 |
813058 |
Russell |
Charles |
L |
202 |
338-9557 |
395733 |
Adams |
John |
Q |
202 |
477-1776 |
502774 |
Kelvey |
Ann |
A |
914 |
555-4156 |
Figure 2. Table as displayed ---------------------------- EMPLOYEE LIST -------------------- ROW 1 OF 5
COMMAND INPUT ===> _ SCROLL ===> PAGE
EMPLOYEES IN DEPARTMENT 27
SELECT ------ EMPLOYEE NAME ------- --- PHONE --- EMPLOYEE
CODE LAST FIRST MI AREA NUMBER SERIAL
Robertson Richard P 301 840-1224 598304
Smith Susan A 301 547-8465 172397
Russell Charles L 202 338-9557 813058
Adams John Q 202 477-1776 395733
Caruso Vincent A 914 294-1168 502774
******************************* BOTTOM OF DATA *******************************
⋮
In this example, the select field (left-most column) does not correspond
to a column in the table. It is used to return a selection code, entered
by the user and placed in a variable named SELECT. The other variables
in the model line correspond to variables in the table. The example
also illustrates the use of two Z variables as placeholders in the
body of the panel and in the model line, the initialization of the
scroll amount field to PAGE, and the specification of a corresponding
help panel.
The same table might be displayed by using several model lines
with the panel definition shown in Figure 3.
Figure 3. Table display panel definition
with several model lines)ATTR
@ TYPE(OUTPUT) INTENS(LOW)
# TYPE(INPUT) PAD('_')
)BODY
%---------------------------- EMPLOYEE LIST ---------------------------------
%COMMAND INPUT ===>_ZCMD %SCROLL ===>_AMT +
+
%EMPLOYEES IN DEPARTMENT@Z +
+
+ENTER CHANGES ON THE LINES BELOW.
+
)MODEL
#Z + SERIAL: @EMPSER + LAST NAME: @LNAME +
PHONE: @PHA@PHNUM + FIRST NAME: @FNAME +
INITIAL: @I +
---------------------------------------------------------------------
)INIT
.ZVARS = '(DEPT SELECT)'
&AMT = PAGE
.HELP = PERS123
)END
The resulting display is shown in Figure 4.
An entry separator, consisting of a dashed line, is also included
as the last model line. In this example, the SELECT field has been
increased to 4 characters, with underscores used as pad characters.
Figure 4. Table as displayed with several model
lines ---------------------------- EMPLOYEE LIST -------------------- ROW 1 OF 5
COMMAND INPUT ===> _ SCROLL ===> PAGE
EMPLOYEES IN DEPARTMENT 27
ENTER CHANGES ON THE LINES BELOW.
___ SERIAL: 598304 LAST NAME: Robertson
PHONE: 301 840-1224 FIRST NAME: Richard
INITIAL: P
---------------------------------------------------------------------
___ SERIAL: 172397 LAST NAME: Smith
PHONE: 301 547-8465 FIRST NAME: Susan
INITIAL: A
---------------------------------------------------------------------
___ SERIAL: 813058 LAST NAME: Russell
PHONE: 202 338-9557 FIRST NAME: Charles
INITIAL: L
---------------------------------------------------------------------
___ SERIAL: 395733 LAST NAME: Adams
PHONE: 202 477-1776 FIRST NAME: John
INITIAL: Q
---------------------------------------------------------------------
___ SERIAL: 502774 LAST NAME: Caruso
PHONE: 914 294-1168 FIRST NAME: Vincent
INITIAL: J
---------------------------------------------------------------------
******************************* BOTTOM OF DATA *******************************