VFW040 – Appendix
VFW040 – Snap in Real Filters
Source Code for Filter iiiVFW05
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #VF_AC007) Height(170) Layoutmanager(#MAIN_LAYOUT) Width(345)
* ================================================================================
* Simple Field, Group and Condition Definitions
* ================================================================================
Group_By Name(#XG_Keys) Fields(< FILE KEYS >)
Group_By Name(#XG_Ident) Fields(#EMPNO #SURNAME #GIVENAME)
Def_List Name(#Save_Keys) Fields(#XG_Keys) Type(*Working) Entrys(1)
Def_Cond Name(*SearchOK) Cond(< INPUT FIELD > *ne *Blanks)
* ================================================================================
* Component definitions
* ================================================================================
* Body and Button arrangement panels
Define_Com Class(#PRIM_PANL) Name(#BODY_PANEL) Displayposition(1) Height(169) Horizontalscroll(True) Layoutmanager(#BODY_FLOW) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Verticalscroll(True) Width(242)
Define_Com Class(#PRIM_PANL) Name(#BUTTON_PANEL) Displayposition(2) Height(169) Layoutmanager(#BUTTON_FLOW) Left(242) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Width(88)
* Attachment and flow layout managers
Define_Com Class(#PRIM_ATLM) Name(#MAIN_LAYOUT)
Define_Com Class(#PRIM_ATLI) Name(#BODY_ATTACH) Attachment(Center) Manage(#BODY_PANEL) Parent(#MAIN_LAYOUT)
Define_Com Class(#PRIM_ATLI) Name(#BUTTON_ATTACH) Attachment(Right) Manage(#BUTTON_PANEL) Parent(#MAIN_LAYOUT)
Define_Com Class(#PRIM_FWLM) Name(#BUTTON_FLOW) Direction(TopToBottom) Flowoperation(Center) Marginbottom(4) Marginleft(4) Marginright(4) Margintop(4) Spacing(4) Spacingitems(4)
Define_Com Class(#PRIM_FWLM) Name(#BODY_FLOW) Direction(TopToBottom) Marginbottom(4) Marginleft(4) Marginright(4) Margintop(4) Spacing(4) Spacingitems(4)
Define_Com Class(#PRIM_PHBN) Name(#Search_Button) Buttondefault(True) Caption('Search') Displayposition(1) Left(4) Parent(#BUTTON_PANEL) Tabposition(1) Top(4)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_Search_Button) Manage(#Search_Button) Parent(#BUTTON_FLOW)
* Define the fields and components that are on the filter form
Define_Com Class(#PRIM_CKBX) Name(#CLEAR_LIST) Caption('Clear List') Displayposition(1) Left(4) Parent(#BODY_PANEL) Tabposition(1) Top(4)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_CLEAR_LIST) Manage(#CLEAR_LIST) Parent(#BODY_FLOW)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_1) Parent(#BODY_FLOW)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_2) Parent(#BODY_FLOW)
* ================================================================================
* Method Definitions
* ================================================================================
Mthroutine Name(uInitialize) Options(*Redefine)
* Restore Clear List button state
Invoke Method(#avFrameworkManager.avRestoreValue) Withid1(*Component) Withid2(#CLEAR_LIST.Name) Toavalue(#CLEAR_LIST.ButtonState) Useavaluedefault(Checked)
* Enable/disable the search button as appropriate
Set Com(#Search_Button) Enabled(*SearchOK)
Endroutine
Mthroutine Name(uSelectData)
* Save the current key values from overwrites done by the select loop
Inz_List Named(#Save_Keys)
* Indicate that Employees instance list updating is about to start
* Clear the current Employees business object instance list
If ('#Clear_List.ButtonState = Checked')
Endif
* Select appropriate instances of Employees
* Set up the visual Identifier(s)
* Add instance details to the instance list
* Indicate that Employees instance list updating is now complete
* Restore the saved key values
Get_Entry Number(1) From_List(#Save_Keys)
*
Endroutine
Evtroutine Handling(< INPUT FIELD >.Changed) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Set Com(#Search_Button) Enabled(*SearchOK)
Endroutine
* --------------------------------------------------------------------------------
* Handle the search button
* --------------------------------------------------------------------------------
Evtroutine Handling(#Search_Button.Click) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Invoke Method(#Com_Owner.uSelectData)
Endroutine
End_Com