UF_QRY01 - Simple Example of How to Listen For General Framework Objects And View Their Properties
============================================================================= * * Component : UF_QRY01 * Type : Reusable Component * Ancestor : VF_AC010 (Command Handler) * * PLEASE NOTE: This UF_ (User Framework) component is the shipped version. You * may choose to modify it. You should do this by copying the source * code of this component into your own component and then change * the copied version. This will prevent the accidental loss of your * changes if you upgrade your Visual LANSA framework version. Refer * to the end of this component for more details about making your * own version of this component. * * This is example code only - No warranty is expressed or implied. * Neither this program, nor any derivative of it, should be ever be used in * production or end-user environments. * * ============================================================================= * * This is the simplest example of how to listen for general Framework objects and view their properties * ============================================================================= Function Options(*DIRECT) Begin_Com Role(*EXTENDS #VF_AC010) Height(336) Layoutmanager(#ATLM_2) Width(552) * ================================================================================ * Simple Field and Group Definitions * ================================================================================ * ================================================================================ * Component definitions * ================================================================================
* List of the GUIDs of all the Commands Def_List Name(#ListCmdGd) Fields(#cmdGUID #cmdUID) Type(*Working) Entrys(*MAX) define #cmdGUID reffld(#vf_elidn) desc('GUID for a command definition') define #cmdUID reffld(#vf_elidn) desc('uIdentifier for a command definition')
* List of the GUIDs of all the Command References Def_List Name(#ListCmRGd) Fields(#cmdRefGUD #cmdRefUID) Type(*Working) Entrys(*MAX) define #cmdRefGUD reffld(#vf_elidn) desc('GUID for a command reference') define #cmdRefUID reffld(#vf_elidn) desc('uIdentifier for a command definition')
* -------------------------------------------------------------------------------- * Handle the save button * --------------------------------------------------------------------------------
* All the Command References are stored as internal members of a single object, #VF_FPM10.
* There is only one object that needs to be stored set_ref #TheVF_FPM10 #TempVF_FPM10
* But to access the information about a particular Command Reference, we need to know * the value of a special property called .CurrentMemberGUID.
* So, store that value in a list
Change #cmdRefGUD #TempVF_FPM10.CurrentMemberGUID
* Store the uIdentifier of the command that is refered to Change #cmdRefUID #TempVF_FPM09.uIdentifier
Add_entry #ListCmRGd
ENDROUTINE
* Check which commands are not used anywhere
mthroutine Check_Unused
clr_list #LTVW_1
selectlist #ListCmdGD
* Which commands do not have a Command Reference that uses them? Loc_Entry In_List(#ListCmRGd) Where(#cmdUID *eq #cmdrefUID)
if_status is_not(*Okay)
* Get Details of the command definition being processed * (Set the GUID property first) set #TheVF_FPM09 CurrentMemberGUID(#cmdGUID)
#df_eltxtl := 'Command: ' + #TheVF_FPM09.uCaption + ' is not used anywhere'
* To see what other command definition properties you can view, click on #TheVF_FPM09 above and press F2, and look at the properties of the VF_FPM09 class