Summary

Visual LANSA

Summary

FRM055 - List Component Basics

Important Observations

  • List components such as combo box and list view are defined visually by creating the list and adding the fields (columns) to the list using drag and drop. Lists have many properties which are used to control the sorting and display of the list.
  • The SELECT command is used to create a loop structure to read and process multiple records from a file based on a specified selection criteria. The SELECT command can be used with physical and logical files.
  • You will usually need to clear the list (CLR_LIST) before populating it. ADD_ENTRY adds an entry to a list component. It creates a new row, with the current values for all fields which make up the list's columns.
  • GET_ENTRY positions to a specific row number in a list component. Form variables will be populated.
  • #SECTS.CurrentItem.focus := true sets the focus on the current item in the list SECTS. Discover the details of such properties using the F2 Feature help.
  • There are many events and properties for list components. This exercise provides a simple introduction to using list components
  • The sorting of list can be controlled at runtime
  • The SUBROUTINE / ENDROUTINE defines a routine which you can EXECUTE from any other routine in your form. Subroutines cannot be defined within an event, method or property routine.
  • You can change the appearance of your application using Visual Styles and Themes.
  • The FOR loop may be used to read a list in its sorted sequence.
  • The SELECTLIST will always read a list in its original loaded order.

Tips & Techniques

  • The logic for combo boxes DEPTS and SECTS in this form, could be extended to build a reusable part, which could be used instead of input fields for department and section code, in a form such as iiiCOM11 – Add Employee:

  • Using reusable parts is covered in the Windows Applications Workshop
  • The ability to put invisible (or hidden) columns into any list is an important concept. In this exercise you want the user to see department description in the combo box, but in the program you need to use the department code (DEPTMENT) as the key field. The need to show the user a description but programmatically interpret their selection from the list as a key is a very common technique.
  • List performance is directly related to the number of entries. Ensure you give users sufficient filtering capabilities, so they do not have to create large lists.
  • When testing lists, ensure you include using volumes of entries which reflect your production database.

What You Should Know

  • How to define a list component and its columns
  • How to fill a list
  • How to use events such as ItemGotSelection
  • How data is mapped into and out of list column source fields.
  • How to use the RDML commands
  • CLR_LIST
  • ADD_ENTRY
  • SELECT / ENDSELECT
  • SUBROUTINE / ENDROUTINE
  • EXECUTE
  • FRM120 – Trigger Function