進階自訂 > 使用可重複使用的元件 > 其他組態資訊 > 使用 MultiValueSelector 值類型
  
使用 MultiValueSelector 值類型
ThingWorx Navigate 8.5 中,您可以使用 JSON 組態檔案配置可重複使用的元件。許多元件針對組態檔案中的某些 JSON 欄位使用 MultiValueSelector 值類型。MultiValueSelector 用於從可用選項清單中取得資料的部份清單。資料可以是項目、屬性、動作或其他類型的資料。某些元件也會使用 MultiValueSetsSelector 值類型,該類型會多次使用 MultiValueSelector 來取得多個資料集。
組態欄位
MultiValueSelector 包含用於唯一識別特定資料片段的四個組態欄位:thingNameinstanceName 用於識別後端系統實例,objectTypeid 用於識別資料。其也包含一些更多的可選欄位。
以下是 MultiValueSelector 中的必填 JSON 欄位:
thingName - 從後端系統擷取資料之轉接器物件的名稱。
instanceName - 從中擷取資料之後端系統的名稱。
objectType - 擷取資料的物件類型。
id - 動作的 ID,如從後端系統接收的。
以下是 MultiValueSelector 中的可選 JSON 欄位:
ordinal - 決定資料在使用者介面中的顯示順序。如需詳細資訊,請參閱使用序數組態欄位
additionalData - 允許其他特定 JSON 欄位來進行進一步的組態。允許的 JSON 欄位取決於特定的可重複使用的元件。請參閱可重複使用元件的範例組態,以查看其允許的其他欄位。
inTailoring - 資料是否可在調整頁中進行調整。輸入可以是 truefalse
範例組態
以下是顯示 MultiValueSelector 結構的範例組態。其也會說明如何使用序數欄位來排序來自不同後端系統的資料。
{
(optional "inTailoring": true)
"version": "1.0.0",
"selectedValues": {
"data": [{
"adapter": {
"thingName": "WindchillAdapterThing",
"instanceName": "JapanWindchill"
},
"itemListsData": [{
"objectType": "WT.PART.WTPart",
"items": [{
"id": "id/name of property",
"additionalData": {JSON representation of additional data, according to another definition in properties},
"ordinal": 1
},
{
"id": "id/name of property",
"additionalData": {JSON representation of additional data, according to another definition in properties},
"ordinal": 2
}]
}
},
{
"adapter": {
"thingName": "WindchillAdapterThing",
"instanceName": "UKWindchill"
},
"itemListsData": [{
"objectType": "WT.PART.WTPart",
"items": [{
"id": "id/name of property",
"additionalData": {JSON representation of additional data, according to another definition in properties},
"ordinal": 0
},
{
"id": "id/name of property",
"additionalData": {JSON representation of additional data, according to another definition in properties},
"ordinal": 3
}]
}]
}]
}
}