I have been putting off trying to implement any UIM screen where I needed to use more than a few List Actions for a List. The problem is there is little to no information about how to successfully implement a screen where you have more options than will fit on the screen above a list. So here is a brief description on what we had to do so that there is a least somewhere that you can find some code that gives a working solution…
You should know that there a are a number of threads on various boards around the internet that discuss this problem, a quick Google Search (or any other search engine you choose) will provide you with a list of those threads. However none of them actually show any code which was used to fulfill the requirement, we knew that we had to do all the heavy lifting as UIM was not going to provide a neat solution like it does for F24 (More function Keys).
Our next release of HA4i is where we are going to use it so the code and screens below are related to it.
First of all I am not an RPG programmer so if you need an RPG solution you may need to work on that, the UIM source should be just the same though.
Here are the various code elements that make it work, we have not included all of the code for the panel and its management as that does not affect this particular requirement.
Variable definitions
:CLASS NAME=vwnumcl BASETYPE='BIN 15'.
:ECLASS.
:VAR NAME=optview CLASS=vwnumcl.
:VARRCD NAME=optionview VARS='optview'.
We need a “CLASS” to base the variable on, we used a short integer (BIN 15) then created a variable called optview. Next we have a Record which would be used to PUT/GET the variable content from the UIM panel called “optionview”.
Condition setting
:COND NAME=optview1
EXPR='optview=0'.
.*
:COND NAME=optview2
EXPR='optview=1'.
.*
:COND NAME=optview3
EXPR='optview=2'.
.*
:TT NAME=opttt
CONDS='optview1 optview2 optview3'.
:TTROW VALUES=' 1 0 0 '.
:TTROW VALUES=' 0 1 0 '.
:TTROW VALUES=' 0 0 1 '.
:ETT.
We have to condition the display of the options and that condition is based on the content of the optview variable, we will be setting this variable in our exit program once the panel is shown. NOTE: The panel complains when conditions are used if you do not provide a Truth Table for the conditions, we created one called “opttt”.
Key Definition
:KEYI KEY=F23 HELP=helpf23
ACTION='CALL exitpgm'
VARUPD=NO.
F23=More Options
The F23 Key is a standard in UIM, you could actually use any key. We have set the key up to call the exit program every time it is pressed. We also do not need the variable pool to be updated as we will be retrieving the existing pool content.
List Actions
:PANEL NAME=rsrstspnl HELP='rsrstspnlh/'
KEYL=basickeys
CSRVAR=csrvar
ENTER='RETURN 500'
ENBGUI=YES
TT=opttt
TOPSEP=SPACE.
HA4i Role Swap Status
:LIST DEPTH='*' LISTDEF=rsrlist
ACTOR=UIM
MAXHEAD=2
PARMS=parms
SCROLL=YES
BOTSEP=NONE.
:TOPINST.
Type options, press Enter.
.* List options ------------------
:LISTACT OPTION=1 HELP='rsrstspnlh/opt1h'
COND=optview1
ENTER='CALL exitpgm'
USREXIT='CALL exitpgm'.
1=Start Env
:LISTACT OPTION=2 HELP='rsrstspnlh/opt2h'
COND=optview1
ENTER='CALL exitpgm'
USREXIT='CALL exitpgm'.
2=End Env
:LISTACT OPTION=3 HELP='rsrstspnlh/opt3h'
COND=optview1
ENTER='CALL exitpgm'
USREXIT='CALL exitpgm'.
3=Prod summary
:LISTACT OPTION=4 HELP='rsrstspnlh/opt4h'
COND=optview1
ENTER='CALL exitpgm'
USREXIT='CALL exitpgm'.
4=Backup summary ...
:LISTACT OPTION=5 HELP='rsrstspnlh/opt5h'
COND=optview2
ENTER='CMD DSPAPYSTS DBKEY(&DBKEY)'.
5=Apy Sts
:LISTACT OPTION=6 HELP='rsrstspnlh/opt6h'
COND=optview2
ENTER='CMD DSPOBJSTS DBKEY(&DBKEY)'.
6=Obj Sts
:LISTACT OPTION=7 HELP='rsrstspnlh/opt7h'
COND=optview2
ENTER='CMD DSPSPLSTS DBKEY(&DBKEY)'.
7=Splf Sts
:LISTACT OPTION=8 HELP='rsrstspnlh/opt8h'
COND=optview2
ENTER='CMD DSPSYNCMGR DBKEY(&DBKEY)'.
8=SyncMgr
:LISTACT OPTION=9 HELP='rsrstspnlh/opt9h'
COND=optview2
ENTER='CMD DSPRTYSTS DBKEY(&DBKEY)'.
9=RetryMgr ...
:LISTACT OPTION=10 HELP='rsrstspnlh/opt10h'
COND=optview3
ENTER='CMD DSPCFGREP DBKEY(&DBKEY)'.
10=CfgRep Sts
:LISTACT OPTION=11 HELP='rsrstspnlh/opt11h'
COND=optview3
ENTER='CMD DSPOBJERR DBKEY(&DBKEY)'.
11=Obj Err
:LISTACT OPTION=12 HELP='rsrstspnlh/opt12h'
COND=optview3
ENTER='CMD DSPPRFERR DBKEY(&DBKEY)'.
12=Prf Err
:LISTACT OPTION=13 HELP='rsrstspnlh/opt10h'
COND=optview3
ENTER='CMD DSPSPLERR DBKEY(&DBKEY)'.
13=Splf Err ...
The actual actions for each of the options is not important for this code, they can be set to anything that you need each option to carry out, the only really important setting is the COND setting. We have decided to have 3 groups of list options which will be cycled through, each is conditioned to display based on the setting of the “optview” variable. We have also left the MAXACTL setting to its default 1 row, we could have set this up to have more options on each page but this is better at showing how this works. You will notice that each entry which is the last one in the list is followed by ‘…’, this is a standard that is suggested by IBM.
Exit Program Code
short int viewOpt = 0; /* option parm */
if(FKeyAct.FunctionKey == 23) {
QUIGETV(FKeyAct.ApplHandle,
&viewOpt,
sizeof(viewOpt),
"OPTIONVIEW",
&Error_Code);
if(Error_Code.EC.Bytes_Available > 0) {
snd_error_msg(Error_Code);
if(debug == 1)
close(fd);
return;
}
if(viewOpt == 0)
viewOpt = 1;
else if(viewOpt == 1)
viewOpt = 2;
else if(viewOpt == 2)
viewOpt = 0;
QUIPUTV(FKeyAct.ApplHandle,
&viewOpt,
sizeof(viewOpt),
"OPTIONVIEW",
&Error_Code);
if(Error_Code.EC.Bytes_Available) {
snd_error_msg(Error_Code);
if(debug == 1)
close(fd);
return;
}
if(debug == 1)
close(fd);
return;
}
All that happens here is when the F23 Key is pressed our exit program is called and a function which handles Function Key actions is called. Within that function we look for which Function Key was pressed, then we pull down the existing ‘optview’ content into our local variable ‘viewOpt’, we then increment that variable to the next view and put it back up to the UIM panel. We do not rebuild any data or display the panel group again, just returning will cause the existing panel to be rebuilt with the new list options being shown.
The above code results in the following displays, pressing the F23 key simply updates the options available.



That is all there is to it, seemed like a real problem when we first looked at it, but its surprisingly simple!
NOTE:- The options are not available to be used if they are not visible! This is something we have not been able to overcome with this solution and nothing in the manuals describes how to change/improve on that…
Chris…
I had a reply from Carsten Flensburg about the F23 options and how to ensure the options were active even if they were not shown.Basically, if you create a second copy of each of the available options and do not set the condition tag but also leave the description blank the options will be available for use but only displayed when the condition is met (The F23 key changes the view).
Thanks to Carsten for letting me have that information.
Chris…