Function SET184T

LANSA

Function SET184T

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_184);
********** COMMENT(Function .......: SET184T);
********** COMMENT(Created on .....: 26/07/00 at 14:43:32);
********** COMMENT(Description ....:Changing input/output mode in a row);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how the mode of a browselist row can be);
********** COMMENT(dynamically changed.);
********** COMMENT(Sometimes you need a field to be input or output based);
********** COMMENT(on the value of another field. This means you can't add);
********** COMMENT(the input or output attribute to the field in the);
********** COMMENT(DEF_LIST as you normally would. *IOCOND is not);
********** COMMENT(supported in LANSA for the WEB.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(Receives: nothing);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(Group and field definitions);
********** COMMENT();
********** COMMENT();
********** 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();
GROUP_BY NAME(#S_GRPPANL) FIELDS((#S_184FDES *INPUT *NOID)(#S_FUNDES *HIDDEN)(#STDRENTRY *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 SET184T)));
********** COMMENT();
DEF_LIST NAME(#S_184TFVC) FIELDS((#S_184CBOX *INPUT)(#S_184CDE *OUTPUT)(#S_184DES *OUTPUT)(#S_184QTY)(#S_184UNIT)(#S_184UPRC)(#S_184TPRC));
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);
WHEN VALUE_IS('= *BLANKS');
********** COMMENT(first time in - populate list and display);
CHANGE FIELD(#STDRENTRY) TO(Y);
CLR_LIST NAMED(#S_184TFVC);
SET_MODE TO(*DISPLAY);
********** 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_184TFVC);
ENDSELECT;
WHEN VALUE_IS('= Y');
********** COMMENT(redisplay with the checked entries input capable);
SELECTLIST NAMED(#S_184TFVC);
IF COND('#S_184CBOX *NE *BLANKS');
SET_MODE TO(*CHANGE);
ELSE;
SET_MODE TO(*DISPLAY);
ENDIF;
UPD_ENTRY IN_LIST(#S_184TFVC);
ENDSELECT;
ENDCASE;
********** COMMENT();
********** COMMENT(Display the list and request the input/output mode);
********** COMMENT();
REQUEST FIELDS(#S_GRPPANL) BROWSELIST(#S_184TFVC) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT(Fields #S_184CDE and #S_184DES are *OUTPUT and are);
********** COMMENT(therefore never input capable. But the other fields);
********** COMMENT(become input capable depending on the mode at the time);
********** COMMENT(the entry is added to the browselist.);