Control : CollectionStatementComplete
![]()
Contents |
[edit] Description
Use the CollectionSatementComplete control to allow a user to select from a filtered list of values as they type into a text edit box. As the user types, a popup is displayed with a list of values from which they can select (or they can continue typing). If the user continues to type, the popup is scanned for text that matches the characters typed.
You control the content of the popup list—when the user types n characters, a notification is sent and the list can then be filled or filtered, as required.
[edit] How To
General Procedure for implementing the CollectionStatementComplete control:
1. Add a form to the class (this form is to be used to display the pop-up list).
2. Add a form interface to the project (to identify the pop-up form).
3. Add the pop-up form interface to the popup form's Interface List property (General tab).
4. Add a collection (of any type) to the class.
5. Drag a FormList control onto the pop-up form and bind the FormList control to the collection.
6. Filter Function
a. Add a function to the class (this function will be invoked when the user types n characters). The function has one [in] argument that contains the text typed by the user. This function is used to fill the list in the pop-up form.
b. Add a function interface to the project to identify the filter function.
c. Add the filter function interface to the function's Interface List property (General tab).
7. Set the Trigger Insert interface
a. The Trigger Insert interface calls a function when an item is inserted. The function requires four arguments:
i. [in] string typedText—Text typed by the user.
ii. [in] string selectedText—Text that's chosen in the list.
iii. [in] int selectedIndex—Index of the item in the list corresponding to the selected text.
iv. [out] data computedItem—Data to be stored in the collection after the function is executed.
To cause the item to not be stored in the list, set this parameter to NULL.
8. Add the CollectionStatementComplete control to your main form and bind it to the class.
9. For the CollectionStatementComplete control:
a. Set the Popup Height and Popup Width properties (Style tab) to the size you want for the pop-up window (if these properties are not set, the pop-up window is not displayed).
b. Clear the Invoke Function on Root property (Behavior tab).
c. Clear the Popup on Root property (Behavior tab).
d. Set the Form Interface property (Interface tab) to the form interface associated with the pop-up form.
e. Set the Trigger Get property (Interface tab) to the function interface associated with the filter function.
f. Set the Trigger Insert property (Interface tab) to the function interface associated with the insert function.
g. Set the StatementList property (Behavior tab) to the field associated with the list you are building using the CollectionStatementComplete control.
Note This is not a collection of suggestions displayed to the user. This is a collection that is added to when the user types data into the control.
[edit] Associated Data Types
- None
[edit] Associated Interface Types
[edit] Required Adapter Types
- None



