1. What will you learn
You will learn how to provide data to the different controls on the xPage and how to enable type-ahead functionality in XPages.
2. Task Description
The profileForm custom control has combobox design elements. You will provide static and dynamic lookup for the possible values for this controls.
3. Detailed Steps
1. Create a Notes form named “keywords”
Add the following fields
Values (Text, Allow Multiple Values)
Select “New Line” as the ONLY delimiter for both options below.
2. Create a Notes view called “keywordLookup”.
The selection formula will be;
Change the first column to show the “Name” field.
Make it sorted Ascending.
3. Preview the form in your Notes client and call the document “TimeZones”, add the text from “codeSnippets/TimeZones.txt”. Escape out of the document and save it.
Preview the form again and call this document “Countries”, add the text from “codeSnippets/Countries.txt”. Escape out of the document and save it.
4. In the profileForm Custom Control select the Gender Combobox. In the “Values” tab specify:
5. Select the “Country” Editbox control. On the Type-ahead tab check the Enable type ahead box and make the Mode “Partial”.
6. Make the Suggestions a computed value and add the following formula:
@DbLookup(@DbName(), "keywordLookup", "Countries", "Values")
7. Uncheck the Case-sensitive checkbox.
8. Select the “TimeZones” Combobox control. On the Values tab click on “Add formula Item
and add this formula:
@DbLookup(@DbName(), "keywordLookup", "TimeZones", "Values")
4. The Result
5. Things To Explore
- Change the Country Edit box to a combobox and make it work with the same data source as used for the type ahead.