Enable the selectedItems Input Binding Property for Item List
This topic describes how to enable the selectedItems input binding property for Item List. The property is useful if you want to preselect an item in the Item List or enable cross-selection for users between the Item List and another widget.
To enable the selectedItems input binding property, implement the GetImplementationSettings service on your custom implementation of the Item List.
The GetImplementationSettings service can contain the following three properties. Each property can hold one or more attributes per item, as long as there is only one attribute per object type.
itemIdentifierKeys
This required key contains the attribute, on each input item, with which the item can be selected. Any other attributes given in the input of selectedItems will be ignored. Only the first specified attribute is considered; any additional attributes are ignored.
If the attribute’s values are unique for each item, then when using selectedItems, only a single item is selected. If it isn't unique, then all items with that value on that attribute are selected.
itemExpansionKeys
This optional key is only relevant when Item List displays hierarchical data. It supports expanding items that are initially collapsed (for example, due to a default expansion level) in the structure tree when a collapsed item is selected using selectedItems. The attributes in itemExpansionKeys are used to identify any items that are missing from the structure. Since the attribute values are used to identify items, the attribute values should be unique for each item.
The default implementation of the following services use itemExpansionKeys: GetChildren, MapItemToInputObject, GetItemsByExpansionPath, GetStructureSkeleton. For more information see the Customization Services section in the Item List topic.
hasChildrenKeys
This optional key is only relevant when Item List displays hierarchical data. hasChildrenKeys contains the name of the attribute on each item that is used to determine if that item has any sub-items or not. If this attribute is missing for an item, or the value of the attribute is false, then the item is assumed to have no sub-items. If hasChildrenKeys is not included, then for the purpose of displaying a tree structure, the presence of an items section under the PTC.Nav.Descendants key on each item on the items data CCO is used as the indicator of sub-items. For more information see Common Communication Object Structure.
Sample Code for GetImplementationSettings 
Sample code for items of a single object type:
"implementationSettings":{
...
"itemIdentifierKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PartUseId",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
],
"itemExpansionKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PathId",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
],
"hasChildrenKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"HasChildren",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
]
}
Sample code for items of multiple object types:
"implementationSettings":{
...
"itemIdentifierKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PartUseId",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
},
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PVTreeId",
"ordinal":0
}
],
"objectType":"PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
],
"itemExpansionKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PathId",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
},
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"PVTreeId",
"ordinal":0
}
],
"objectType":"PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
],
"hasChildrenKeys":[
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"HasChildren",
"ordinal":0
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
},
{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"HasChildren",
"ordinal":0
}
],
"objectType":"PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
]
}
Was this helpful?