RDMLX for a WAM Mini Filter

Visual LANSA Framework

RDMLX for a WAM Mini Filter

 

 * ================================================================================

* Description ...: Mini Filter (Simple)

* ================================================================================

Function Options(*DIRECT)

Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet('vlf_layout')

 

*  Standard declares for a filter

 

Define_Com Class(#vf_sw100) Name(#avFrameworkManager)

Define_Com Class(#vf_aw007) Name(#ThisFilter) Reference(*Dynamic)

Define_Com Class(#vf_lw002) Name(#avListManager) Reference(*Dynamic)

Define_Com Class(#fp_in001) Name(#FastPart) Reference(*Dynamic)

 

*  VL Framework map fields. DO NOT CHANGE.

 

Web_Map For(*both) Fields((#VF_FRAMEI *private) (#VF_FRAMEW *private) (#VF_FRAMES *private) (#VF_ELXTOF *private) (#VF_ELXN01 *private) (#VF_ELXN02 *private) (#VF_ELXN03 *private) (#VF_ELXN04 *private) (#VF_ELXN05 *private) (#VF_ELXN06 *private) (#VF_ELXN07 *private) (#VF_ELXN08 *private) (#VF_ELXN09 *private) (#VF_ELXN10 *private) (#VF_ELXA01 *private) (#VF_ELXA02 *private) (#VF_ELXA03 *private) (#VF_ELXA04 *private) (#VF_ELXA05 *private) (#VF_ELXA06 *private) (#VF_ELXA07 *private) (#VF_ELXA08 *private) (#VF_ELXA09 *private) (#VF_ELXA10 *private) (#VF_ELMETA *private))

 

*  Standard webroutine used by all VLF WAM filters and command handlers. DO NOT CHANGE the Web routine name. Use this routine to register WAM events.

 

Webroutine Name(UHandleEvent)

 

*  Standard WAM initialisation.

 

* NOTE: THE EVENTS FOR MINI FILTERS ARE PRE REGISTERED IN THE FRAMEWORK. THEREFORE, YOU DON'T NEED TO REGISTER THEM. THEY ARE:

* uWAMEvent_21 --> mini filter button ONE was clicked

* uWAMEvent_22 --> mini filter button TWO was clicked

* uWAMEvent_23 --> mini filter button THREE was clicked

 

#avFrameworkManager.avInitializeWAM Type(FILTER) Invoker(#com_owner) Listmanager(#avListManager) Filtermanager(#ThisFilter) Fastpartmanager(#FastPart)

 

#avFrameworkManager.avHandleWAMEvent Anchorblock(#vf_framew) Event(#vf_event) Designmode(#vf_framed) Skin(#VF_Frames) Metatag(#vf_elmeta) Tof(#vf_elxtof) N01(#vf_elxn01) N02(#vf_elxn02) N03(#vf_elxn03) N04(#vf_elxn04) N05(#vf_elxn05) N06(#vf_elxn06) N07(#vf_elxn07) N08(#vf_elxn08) N09(#vf_elxn09) N10(#vf_elxn10) A01(#vf_elxA01) A02(#vf_elxA02) A03(#vf_elxA03) A04(#vf_elxA04) A05(#vf_elxA05) A06(#vf_elxA06) A07(#vf_elxA07) A08(#vf_elxA08) A09(#vf_elxA09) A10(#vf_elxA10) Ssiname(#VF_FRAMEI)

 

Endroutine

 

*  Handle initialization of filter

 

Evtroutine Handling(#avFrameworkManager.uexecute) Options(*noclearmessages *noclearerrors)

 

* Activate this Filter as a mini Filter

 

* This filter will use a search field and search button on the framework identification bar (below the toolbar)

* to interact with the user. This filter will not be displayed.

 

* Note: This should be the only filter for this business object.

 

* Enable one search field and one search button on the mini filter. Give them captions, and widths if required.

 

Set Com(#thisfilter) Avminifilter(true) Avminifiltfield1(true) Avminifiltfldcapwid1(250) Avminifiltfldcap1(*MTXTDF_SURNAME) Avminifiltfldwid1(350) Avminifiltbutton1(true) Avminifiltbuttoncap1(*MTXTDF_SEARCH) Avminifiltbuttonwid1(150)

 

Endroutine

 

Evtroutine Handling(#avFrameworkManager.uWAMEvent_21) Options(*noclearmessages *noclearerrors) Value1(#Val1)

 

* The value that the user entered on the search field on the framework identification bar is provided in the Value1 parameter of this event routine.

#Surname := #Val1.UpperCase

 

* Start instance list update. Clear the instance list

#avListManager.BeginListUpdate

#avListManager.ClearList

 

* Fill the instance list based on the search value specified by the user.

Select Fields(#SURNAME #GIVENAME #EMPNO #PHONEHME #ADDRESS1 #POSTCODE) From_File(PSLMST2) With_Key(#SURNAME) Generic(*YES)

Execute Subroutine(ADDLIST)

Endselect

* Instance list updating has been completed

#avListManager.EndListUpdate

 

Endroutine

 

* ================================================

* SUBROUTINE: Add an entry to Instance List

* ================================================

Subroutine Name(ADDLIST)

* Build up visual identifier

 

#Fullname := #Givename + " " + #Surname

 

* Add to instance list using the user defined

* identification protocol:

 

* =====================

* Visual Identification

* =====================

* VisualID1 = Employee Number

* VisualID2 = Concatenation of first name (#GiveName)

* and last name (#SurName)

* ===========================

* Programmatic Identification

* ===========================

* AKey1 = Employee number

* ====================================================

* Additional Columns for instance list manager

* ====================================================

* AColumn1 = Phone (Home)

* AColumn2 = Address Line 1

* NColumn1 = Post Code (Zip)

#avListManager.addToList Visualid1(#Empno) Visualid2(#Fullname) Akey1(#Empno) Acolumn1(#Phonehme) Acolumn2(#Address1) Ncolumn1(#Postcode)

 

Endroutine

 

End_Com