The Virtual Clipboard
Applies to Windows and WAM.
The Framework services manager provides a virtual clipboard facility. See the tutorial VLF012WIN - Controlling Navigation Using Switching and the Virtual Clipboard or VLF012WAM - Controlling Navigation Using Switching and the Virtual Clipboard for step-by-step instructions for how to use the virtual clipboard.
Note: Most of the facilities that the virtual clipboard provides are available in Windows or Web browser applications. The recommended way of learning to use the virtual clipboard is to conceptually understand this material from the Windows point of view.
The clipboard is designed to serve two main needs:
- For Remembering Information between application executions.
- For Exchanging Information between components.
To use the virtual clipboard most effectively you need to devise a standardized naming protocol for items that are posted onto it.
The clipboard uses a minimum 3 part naming standard and any name can support multiple instances (i.e.: become a list of values) and optionally function in multiple languages, so it's quite easy to devise an object.property style naming model for information that is posted to it.
For example, when a user starts using a General Ledger application they may need to select the Company and a Currency that they will be working with. These values are accessed by lots of filters and command handlers within the application as the user moves around.
Conceptually, we now have a "GL Application" object that contains "SelectedCompany" and "SelectedCurrency" properties.
Using the clipboard you can easily define GLAPPLICATION.SelectedCompany and GLAPPLICATION.SelectedCurrency as things on the clipboard. Your GLAPPLICATION clipboard object is infinitely extensible without application recompiles and can contain lists, etc as required.
In both Windows and WAM browser applications you would code this naming standard as:
Invoke #AvFrameworkManager.avRestoreValue WithID1(GLAPPLICATION) WithID2(SelectedCompany) ToAValue(#CompanyNo)
Invoke #AvFrameworkManager.avRestoreValue WithID1(GLAPPLICATION) WithID2(SelectedCurrency) ToAValue(#CurrCode)
Equally you might devise a naming protocol for information that is private (i.e., scoped) within an individual function. For example, you might use PRIVATE.<function name>.<property name>. To save the value of #EMPNO using the naming standard as PRIVATE.<function name>.EmployeeNumber you might code this in a Windows or WAM browser application:
Invoke #AvFrameworkManager.avSaveValue WithID1(PRIVATE) WithID2(*COMPONENT) WithID3(EmployeeNumber) FromAValue(#Empno)
See also: