Select your user interface:
Context
When it comes time to display a data list, we may have to provide context to the Data List Spec. For an example of context, let's look at the Widgets Parts data list. When we view the Widget Parts data list, we have to provide the data list with the ID of the widget we need Infinity to display. After we have the ID of the widget, the data list can narrow down the parts in the data list for a particular widget. Since the Widget Parts data list displays part for a widget then the context is "Widget." In the XML for the Widgets Parts data list, we can see the use of the ContextRecordType attribute within the spec:
<Context ContextRecordType="Widget" RecordIDParameter="WIDGETID"/>
Example: The Context element declares the type of context the spec receives.
So when the Context element is included in a DataListSpec, the data list expects some sort of context. The context value typically takes the form of a GUID. In the case of this data list, it expects the ID that uniquely identifies a widget in the database.
Warning: The value of the ContextRecordType attribute within the Context element should match the value of the Name attribute within the corresponding Table Spec. If you open the Table Spec for the Widget table, you will find that its Name attribute is equal to "Widget."
<TableSpec
XMLns="bb_appfx_table"
XMLns:common="bb_appfx_commontypes"
ID="1967566f-e928-41d7-8318-6c491db9bec6"
Name="Widget"
Description="The WIDGET table is the primary table for storing data about a widget."
Author="SDK Author"
IsCustomizable="true"
Tablename="USR_WIDGET"
>
Example: The Name attribute of a TableSpec corresponds to the ContextRecordType attribute within a DataListSpec.
When it comes time to display the data list within a page, we have to provide the context to the Widget Parts data list. With the shell in Design Mode, we can configure the Widget page's section to pass the context of the Widget page. The data list accepts the ID of the widget and passes the value to the data list's underlying stored procedure.