As an example, assume your Smart Client is going to support setting property values, InsulPurpose and InsulSpec properties for a Pipe, by items in their bound select lists.
The following list provides an overview of the steps required:
-
Search the annotations metadata document to discover the select list key for your first, or top-level, object property. For our example: “Insulation Purpose” is bound to the Pipe\InsulPurpose property. For details, see Properties bound to select list.
-
Query for the select list key if it is different than the string in the annotation:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists?$filter=Name eq 'Insulation Purpose'&$select=Id
-
Use the Id to query for the Insulation Purpose Items:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists('InsulPurpose')/Items
-
Bind these items to your first drop-down or pick-list.
-
The user selects an Insulation Purpose value from the drop-down, either “H” or “C”.
-
Search the annotations metadata document to discover the select list key for your second object property. For our example: “Insulation Spec” is bound to the Pipe\InsulSpec property. For details, see Properties bound to select list for details.
-
Query for the select list key if it is different than the string in the annotation:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists?$filter=Name eq 'Insulation Spec'&$select=Id
-
Use the Id to query for the Insulation Spec items, and limit the query to items related to the current Insulation Purpose selected. For example:
-
If the user selects “C”, where Name or Id can be used for the query:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists('InsulSpec')/Items?$filter=Parent/Id eq 'C'
-
If user selects Insulation Purpose “H”:
GET https://sam.spclouddave.com/SampleService/Sppid/V2/SelectLists('InsulSpec')/Items?$filter=Parent/Id eq 'H'
-
The logical representation of this data looks like:
Insulation Spec Items returned
-
FG-C
(Related to Parent Item “C” from Insulation Purpose)
-
GS-H
-
FG-H
(Related to Parent Item “H” from Insulation Purpose)