Step 1. Create Your Real By Name Filter
VFW040 – Snap in Real Filters
In this step you will create a real filter (a Reusable Part) which search the file PSLMST by surname, and populate the Instance List. You will learn how to use the
.1. In the Framework, select the Employees business object and click the
button on the By Name filter.
You could also access the
from the menu.The
allows you to create different types of component which can be plugged into your filters, instance lists and command handlers.Initially you will probably select filters which generate a complete component (for example,
). As you become more expert, you might use a skeleton filter, or copy from one which is similar to what you need and complete the code manually.2. If you are using a non-English system, click on
which is the first entry in the Coding Assistant's tree view. In the panel, select . Click the button to set your coding preferences.3. In the tree view select
.
4. If your Framework is enabled for Web development, Select
as the target platform.5. In the list headed
, select .
6. Click the
button. The coding assistant is a wizard which will present a series of panels which you will complete to generate the filter code required. There may be optional sections on these panels which you will complete as necessary to generate the logic required.7. On the first panel enter PSLMST as
.Based on the file key and first two fields on the file, the coding assistant suggests the fields required to define the
and .
- A Visual Identifier is the field or fields that a user would use to identify a unique instance of an object
- A Programmatic Identifier is the field(s) that the program would use to identify a unique instance of the business object. Typically these would be the primary keys of the file or files that make up the data in the instance list.
- The additional columns should be completed, if necessary, to correspond to any additional columns which you have added to your instance list, during the prototyping phase.
In this case, the generated code will use EMPNO and FULLNAME (based on SURNAME plus GIVENAME) to define the visual identifiers.
EMPNO defines the programmatic identifier
8. Click the
button.9. On the next panel, select PSLMST2 as
.10. Select SURNAME as the key(s) of the
. SURNAME will be the input field on the filter panel.Select the following options:
- Allow generic searching
- Remember key values between filter executions
- Allow the user to clear the instance list
11. Click the
button. Select the check box .
12. Click the
button.The generated code will be displayed.
You now simply need to create the component by specifying its
and clicking the button. VLF code assistant, currently limits reusable part names to 9 characters.13. Specify iiiVFW04 as the filter name, where iii are your initials, and Employee By Name Filter as the description. If you are using an unlicenced or trial version of Visual LANSA your component names must be of the form DEMCOM05. Click the button.
When you click the
button, a reusable part will be created in the Repository and the code will be copied into the editor.After a brief delay, a message
will be displayed.14. Switch to Visual LANSA and compile the reusable part.