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

Visual LANSA Framework

 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 field 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.   Make sure the source code of your mini filter is visible.

4.   Locate the #SURNAME.KeyPress event routine.

5.   Add this statement above the END_IF statement:

 

Invoke #AvFrameworkManager.avSaveValue WithID1(SURNAME) FromAValue(#SurName)

 

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 #AvFrameworkManager.avRestoreValue WithID1(SURNAME) ToAValue(#SurName)

 

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.