Function SET011C: Build Browselist Using Radio Button

LANSA

Function SET011C: Build Browselist Using Radio Button

FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_011);
********** COMMENT(Function .......: SET011C);
********** COMMENT(Created on .....: 20/02/00);
********** COMMENT();
********** COMMENT(Full Description: This function builds the Employee);
********** COMMENT(browselist using a Radio Button as the selectable field);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT(*******************************************************);
OVERRIDE FIELD(#S_011RBSE) COLHDG(' View' ' Details');
OVERRIDE FIELD(#FULLNAME) COLHDG('Employee' ' Name');
********** COMMENT(These fields are used to pass the values of the);
********** COMMENT(selected employee (when selected in the broselist) and);
********** COMMENT(Department and Section when selected from the menu.);
********** COMMENT(Refer to components S_011ADDSUBITM and S_011RBSE and);
********** COMMENT(the Java Script functions SetKey (added to the HTML of);
********** COMMENT(SET011C) and ShowEmpDet in the HTML of SET011D).);
DEFINE FIELD(#S_EMPNUMB) REFFLD(#EMPNO);
DEFINE FIELD(#SELT_DEPT) REFFLD(#DEPTMENT);
DEFINE FIELD(#SELT_SECT) REFFLD(#SECTION);
********** COMMENT(Fields used in <ONCONDITION> tags:);
********** COMMENT(HAS_EMPLO, if no employess in selected department/sect);
********** COMMENT(display a message (component S_011NOEM).);
DEFINE FIELD(#HAS_EMPLO) REFFLD(#LISTCOUNT) TO_OVERLAY(#LISTCOUNT 001);
********** COMMENT(FIRS_TIME don't show empty browselist);
DEFINE FIELD(#FIRS_TIME) TYPE(*DEC) LENGTH(001) DECIMALS(0);
********** COMMENT();
GROUP_BY NAME(#PANELDATA) FIELDS((#S_EMPNUMB *HIDDEN)(#HAS_EMPLO *HIDDEN)(#STDRENTRY *HIDDEN)(#FIRS_TIME *HIDDEN)(#DEPTDESC *HIDDEN)(#SECDESC *HIDDEN));
********** COMMENT(Employee browselist.);
DEF_LIST NAME(#S_011EMPL) FIELDS((#S_011RBSE *INPUT)(#EMPNO)(#FULLNAME)) COUNTER(#LISTCOUNT);
********** COMMENT();
CLR_LIST NAMED(#S_011EMPL);
********** COMMENT();
IF COND('#stdrentry *ne Y');
CHANGE FIELD(#STDRENTRY) TO(Y);
CHANGE FIELD(#FIRS_TIME) TO(0);
GOTO LABEL(REQ);
ENDIF;
********** COMMENT();
CHANGE FIELD(#FIRS_TIME) TO(1);
********** COMMENT();
********** COMMENT(Fetch the department and section descriptions to merge);
********** COMMENT(as the header of the SET011C, in component);
********** COMMENT(S_011EMPLISTHEADER);
FETCH FIELDS(#DEPTDESC) FROM_FILE(DEPTAB) WITH_KEY(#SELT_DEPT);
FETCH FIELDS(#SECDESC) FROM_FILE(SECTAB) WITH_KEY(#SELT_DEPT #SELT_SECT);
********** COMMENT();
********** COMMENT(Select Employees from the selected department/section);
********** COMMENT(and add to the browselist.);
SELECT FIELDS((#GIVENAME)(#SURNAME)(#EMPNO)) FROM_FILE(PSLMST1) WITH_KEY(#SELT_DEPT #SELT_SECT);
USE BUILTIN(BCONCAT) WITH_ARGS(#GIVENAME #SURNAME) TO_GET(#FULLNAME);
ADD_ENTRY TO_LIST(#S_011EMPL);
ENDSELECT;
********** COMMENT();
REQ: REQUEST FIELDS(#PANELDATA) BROWSELIST(#S_011EMPL) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT(*******************************************************);