Step 4. Use the Virtual Clipboard to Save and Restore the Search Value

In this step you will learn how to use the Virtual Clipboard to save the value the end-user enters in the surname and restore it the next time the Framework is executed.

To do this you will use the Framework Manager methods avSaveValue and avRestoreValue.


1.   Exit from the Framework.

2.   Display the Visual LANSA editor.

3.   Select the Source tab.

4.   Locate the #SURNAME.KeyPress event routine.

5.   Add this statement above the END_IF statement:

Invoke Method(#AvFrameworkManager.avSaveValue) Withid1(SURNAME) Fromavalueu(#xEmployeeSurname)

This statement saves the value of the #SURNAME field in the Virtual Clipboard with the symbolic name SURNAME.


6.   Next locate the uInitialize event and add this statement before the ENDROUTINE statement so that the value of SURNAME is restored from the Virtual Clipboard:

Invoke Method(#AvFrameworkManager.avRestoreValue) Withid1(SURNAME) Toavalueu(#xEmployeeSurname)




7.   Now compile the filter.

8.   Start the Framework and locate the Employees business object.

9.   Type S in the mini filter and press Enter to fill the instance list.

10.   Close the Framework and start it again and select the Employees business object. Notice that the mini filter now contains the letter S which was entered in the previous Framework execution.