Configuring keyed access in a data page
To provide instant access to a particular page in a list-structure data page, enable keyed access. For example, you can easily access a list of products with an embedded page that holds information about a particular product.
By using keyed data pages, you avoid maintaining two separate data pages: one page to return a list of items and a second page to return information about a single item in the list.
You can enable keyed access for read-only data pages with a thread or requestor scope.
In the navigation pane of Dev Studio, click Records.
Expand the Data Model category, and then click Data Page.
Click a data page to open it.
On the Definition tab, in the Keyed page access section, click Access pages with user defined keys.
In the Page list keys section, click Add key to define one or more keys for the data page. Press the Down arrow key to select from the properties in the class of the data page, or click Open to create a new one..SupplierID or .IndustryYou must pass either all or no keys to the data page at run-time to allow one data page to serve a dual purpose:
- It can display all the items it contains (no keys passed).
- It can return only items that match the keys.
To enable the data page to return multiple embedded pages from a single instance to an auto-populated page list property, click Allow multiple pages per key.You might use this option when preparing to display a list of all the products offered by a particular provider.You can use this option only with an auto-populated page list property. If the option is not selected, you can populate a page property.
Open the property, and in the Data access section, reference the keyed data page in the page property by using the selected keys. For more information, see Configuring page, page group, and page list properties.You can use both parameters and keys in the property.
To retrieve the data, the property that requires the data references the data page and sends a property reference or a literal value to populate the data page key. When the property is referenced, the system automatically loads the data page using the value that the property sends as the key.
- The parameters determine the instance of a data page that is loaded and selected.
- The keys determine which embedded page within a given instance to return.
ArticleCreating a data page