Pass a Parameter from a Widget to a Data List

A new Kitchen Sink sample demonstrates the ability to pass parameters from a UI widget to a data list. This new sample illustrates how the DataList element's child ParameterSection element on page specs allows you to set up UI widgets and data lists that work together by passing parameters from the widgets to update the data lists.

From Kitchen Sink, click Grid views under Data lists. On the Grid views page, the new sample appears on the UIWidget Parameter Section tab. In the UI Widget section's Start and End fields, you can enter start and end dates. After you select both dates, the Data List section filters the list to only display entries in that range.

On the page spec for the Grid viewspage, the Tabs element includes three Tab elements for the Standard grid tab, the Grid view with mapped detail form tab, and the UIWidget Parameter Section tab. Within the thirdTab element, the Sections element includes two Section elements, one for the UI Widget section and one for the Data List section.

Within the first Section element, the ID attribute provides a GUID to identify the section, while the child UIWidget element's ID attribute provides a GUID for the UI widget to display in the section. The ParemeterSection element's ID attribute requires the first GUID for the UI widget section to identify the source of the parameter value, not the second GUID for the UI widget itself.

<Tab ID="5B64D7D7-ED72-4142-B985-37CB5C7298FC" Caption="UIWidget Parameter Section">
<!-- define the sections for this tab -->
<Sections>
<Section ID="5CB94A01-875B-4BD0-B19F-99DF7C3E89FB" Caption="UI Widget">
<UIWidget ID="e15be872-b543-43fc-b2ae-fe56ec496ad3"></UIWidget>
</Section>

Within the second Section element, the DataList element defines the data list for the section, and its child ParameterSection element specifies the parameter to pass from the UI widget to the data list.

  <Section ID="168645E1-8810-445C-8731-9D45718A66EB" Caption="Data List">
<DataList ID="87d2d322-937e-433b-b0a5-3257e3e9acf5">
<RenderStyle>
<StandardView>
</StandardView>
</RenderStyle>
<ParameterSection ID="5CB94A01-875B-4BD0-B19F-99DF7C3E89FB" HideOwnFilters="false">
<FieldMappings>
<FieldMapping>
<ParameterField>STARTDATE</ParameterField>
<DestinationField>STARTDATE</DestinationField>
</FieldMapping>
<FieldMapping>
<ParameterField>ENDDATE</ParameterField>
<DestinationField>ENDDATE</DestinationField>
</FieldMapping>
</FieldMappings>
</ParameterSection>
</DataList> </Section> </Sections> </Tab>

Within the a ParameterSection element, the ID attribute provides the GUID from the ID attribute for the UI Widget section to indicate the source of the parameter to pass to the data list. Meanwhile, the HideOwnFilters attribute is set to "false" to display standard filters in the UI Widget section.

Next, the FieldMappings element contains the FieldMapping elements to map fields from the UI widget to the data list.

Within the FieldMapping elements, the ParameterField elements specify widget fields that provides parameter values, and the corresponding DestinationField elements specify the data list fields that receive the values. In the Kitchen Sink sample, the widget's STARTDATE and ENDDATE fields provide values from the UI widget while the data list's corresponding STARTDATE and ENDDATE fields receive the values for the data list.

Tip: For information about a similar Kitchen Sink sample that passes parameters from a UI widget to a list builders, see Pass a Parameter from Widget to a List Builder.