================================================================================
* Type : FILTER
* Ancestor : VF_AC007
* Application : Programming Techniques (Advanced)
* Business Object : Mini Filter (Simple)
* Filter : Mini Filter (Simple)
* Note: This should be the only filter for this business object
* ================================================================================
Begin_Com Role(*EXTENDS #VF_AC007) Height(138) Width(303)
* =============================================================================
* Component definitions
* =============================================================================
* Nothing is displayed by this filter.
* The Framework mini filter supplies the search button and the search field
* This filter communicates with the mini filter on the Framework identification bar
* using properties like avMiniFiltField1, and using the redefined method routine
* called uMiniFilterButton.
* =============================================================================
* Method Routine Redefines
* =============================================================================
*
* Initialize
*
Mthroutine Name(uInitialize) Options(*REDEFINE)
* Make the mini filter visible for this business object
* Note: This should be the only filter for this business object
set #Com_Owner avMiniFilter(TRUE)
* Enable one search field and one search button on the mini filter
* Give them captions, and widths if required
set #Com_Owner avMiniFiltField1(TRUE)
* set the total field width (including caption) to 300
set #Com_Owner avMiniFiltFldWid1(300)
set #Com_Owner avMiniFiltFldCap1(*MTXTDF_SURNAME)
* set the caption width to 200
set #Com_Owner avMiniFiltFldCapWid1(200)
set #Com_Owner avMiniFiltButton1(TRUE)
set #Com_Owner avMiniFiltButtonCap1(*MTXTDF_SEARCH)
* set #Com_Owner avMiniFiltButtonWid1(200)
* You could also pass an initial search value using:
* set #Com_Owner avMiniFiltValue1('my initial search value')
endroutine
*
* Perform Search instruction from the mini search panel
*
Mthroutine Name(uMiniFilterButton) Desc('Handle a mini filter button click') Help('Overwrite this method with your own logic if required.') Options(*REDEFINE)
* Define_Map For(*input) Class(#vf_elnum) Name(#uButton)
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue1) Mandatory(' ')
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue2) Mandatory(' ')
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue3) Mandatory(' ')
Define #Button *dec 1 0
* Determine which mini filter button the user pressed
change #Button #uButton
case #button
when '= 1'
* Get the search value that the user entered into the mini filter
USE BUILTIN(UPPERCASE) WITH_ARGS(#UVALUE1) TO_GET(#SURNAME)
* Do the search and put the results into the instance list
Invoke Method(#avListManager.BeginListUpdate)
Invoke Method(#avListManager.ClearList)
* Select employee records using full or partial surname in surname order and add to instance list
Select Fields(#EMPNO #GIVENAME #SURNAME) From_File(PSLMST2) With_Key(#SURNAME) Generic(*YES)
* add an entry to the instance list on the right of the filter
Execute Subroutine(ADDLIST) With_Parms(#SURNAME #GIVENAME #EMPNO)
Endselect
* Indicate end of list update
Invoke Method(#avListManager.EndListUpdate)
endcase
endroutine
* =============================================================================
* Subroutines
* =============================================================================
*
* add an entry to the instance list on the right of the filter
*
Subroutine Name(ADDLIST) Parms(#SURNAME #GIVENAME #EMPNO)
* Build up visual identifier
Use BConcat (#GiveName #SurName) #FullName
Invoke Method(#avListManager.AddtoList) Visualid1(#Empno) Visualid2(#FullName) Akey1(#Empno)
Endroutine
End_Com