Function SET184Q

LANSA

Function SET184Q

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_184);
********** COMMENT(Function .......: SET184Q);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....: Using checkbox selection);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how to allow the user to select browselist);
********** COMMENT(entries using checkboxes.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
GROUP_BY NAME(#S_GRPPANL) FIELDS((#S_184FDES *INPUT *NOID)(#STDRENTRY *HIDDEN)(#S_FUNDES *HIDDEN));
********** COMMENT((Field #S_184FDES has a component S_184FDES which);
********** COMMENT(merges in a component with the same name as the);
********** COMMENT(function (in this case component SET184Q)));
********** COMMENT();
********** COMMENT((Component SET184Q refers to a web link component);
********** COMMENT(S_184QNXT that links to this function again));
********** COMMENT();
GROUP_BY NAME(#S_GRPENTR) FIELDS((#S_184FDES *INPUT *NOID)(#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)(#S_184IMG *NOID *INPUT)(#STDRENTRY *HIDDEN));
********** COMMENT((Field #S_184FDES has a component S_184FDES which);
********** COMMENT(merges in a component SET184Q2));
********** COMMENT();
********** COMMENT((Field #S_184IMG has a component S_184IMG that displays);
********** COMMENT(the picture));
********** COMMENT();
********** COMMENT((Component SET184Q2 refers to a web link component);
********** COMMENT(S_184QNXT that links to this function again));
********** COMMENT();
DEFINE FIELD(#S_184CBOX) TYPE(*CHAR) LENGTH(001) COLHDG('Checkbox' 'Selector');
********** COMMENT((This field has an attached visual component that);
********** COMMENT(displays it as a checkbox. (Component S_184CBOX)));
********** COMMENT();
********** COMMENT();
DEF_LIST NAME(#S_184QFVC) FIELDS((#S_184CBOX *INPUT)(#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)(#S_184IMG *HIDDEN));
DEF_LIST NAME(#S_WRKFVC) FIELDS((#S_184CDE)(#S_184DES)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC)(#S_184IMG)) TYPE(*WORKING) ENTRYS(0000500);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
CHANGE FIELD(#S_FUNDES) TO(*FUNCTION_DESC);
********** COMMENT();
CASE OF_FIELD(#STDRENTRY);
********** COMMENT();
WHEN VALUE_IS('= *BLANKS');
********** COMMENT(first time in - populate the browselist and diplay it);
CHANGE FIELD(#STDRENTRY) TO(Y);
CLR_LIST NAMED(#S_184QFVC);
********** COMMENT(Function SET184Y populates list #S_WRKFVC with data);
CALL PROCESS(*DIRECT) FUNCTION(SET184Y) PASS_LST(#S_WRKFVC );
SELECTLIST NAMED(#S_WRKFVC);
ADD_ENTRY TO_LIST(#S_184QFVC);
ENDSELECT;
********** COMMENT(continue on and display the browselist);
********** COMMENT();
WHEN VALUE_IS('= Y');
********** COMMENT(If there are any checked entries in the browselist);
********** COMMENT(display them.);
SELECTLIST NAMED(#S_184QFVC);
IF COND('#S_184CBOX *NE *BLANKS');
********** COMMENT(uncheck the entry so that it is not displayed again);
CHANGE FIELD(#S_184CBOX) TO(*BLANKS);
UPD_ENTRY IN_LIST(#S_184QFVC);
********** COMMENT(display the checked list entry);
CHANGE FIELD(#S_184FDES) TO(SET184Q2);
DISPLAY FIELDS(#S_GRPENTR) DESIGN(*DOWN) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
ENDIF;
ENDSELECT;
********** COMMENT(If no entries were checked, redisplay the browselist);
ENDCASE;
********** COMMENT(Display the browselist);
********** COMMENT();
CHANGE FIELD(#S_184FDES) TO(SET184Q);
REQUEST FIELDS(#S_GRPPANL) BROWSELIST(#S_184QFVC) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();