1
集計タイプバインディングで式バインディングを使用することは可能ですか?テーブルがあり、テーブルの各行にはsap.m.Selectコントロールを持つ列があります。私は行のプロパティに基づいて異なる項目で各行の選択コントロールをバインドしたい。以下はSAPUI5 - 集約バインディングタイプの式バインディング
は私のサンプル例です:
<Table headerText="Dimensions/Measures" mode="MultiSelect" includeItemInSelection="true" items="{path: 'dataModel>/Fields'}">
<columns>
<Column hAlign="Center" vAlign="Center" visible="true">
<header>
<Label text="Dimensions/Measures" />
</header>
</Column>
<Column hAlign="Center" vAlign="Center" visible="true">
<header>
<Label text="Type" />
</header>
</Column>
<Column hAlign="Center" vAlign="Center" visible="true">
<header>
<Label text="Role" />
</header>
</Column>
</columns>
<ColumnListItem>
<Text text="{dataModel>Fieldname}" />
<Text text="{= ${dataModel>Aggr_Oper} !== null ? 'Measure' : 'Dimension'}" />
<Select items="{= ${path: 'dataModel>Aggr_Oper'} !== null ? ${dataModel>/chartConfigData/dimData}: ${dataModel>/chartConfigData/measData}}">
<core:Item key="{dataModel>key}" text="{dataModel>text}" />
</Select>
</ColumnListItem>
</Table>
私のデータモデルは以下のようになります。
{
"Fields":[
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"PropertyID",
"FieldDescription":"PropertyID",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":1,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":"true",
"Sort_Op":"ASC",
"Sort_Order":1,
"ChartRole":null,
"BusinessEntity":"BRS"
},
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"Description",
"FieldDescription":"Description",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":2,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":"true",
"Sort_Op":null,
"Sort_Order":null,
"ChartRole":null,
"BusinessEntity":"BRS"
},
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"PropertyTypeID",
"FieldDescription":"PropertyTypeID",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":3,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":"true",
"Sort_Op":null,
"Sort_Order":null,
"ChartRole":null,
"BusinessEntity":"BRS"
},
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"PropertyType",
"FieldDescription":"PropertyType",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":4,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":null,
"Sort_Op":null,
"Sort_Order":null,
"ChartRole":null,
"BusinessEntity":"BRS"
},
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"RegionID",
"FieldDescription":"RegionID",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":5,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":null,
"Sort_Op":null,
"Sort_Order":null,
"ChartRole":null,
"BusinessEntity":"BRS"
},
{
"AppID":"RP_PROP",
"AppVariantID":"PropListVariantDemo",
"Fieldname":"RegionDescription",
"FieldDescription":"RegionDescription",
"Aggr_Oper":null,
"Filterable":null,
"Visible":"true",
"Filter_Val":null,
"DisplayOrder":6,
"FieldGroup":null,
"SubTotal":null,
"FieldType":null,
"Sortable":null,
"Sort_Op":null,
"Sort_Order":null,
"ChartRole":null,
"BusinessEntity":"BRS"
}
],
"chartConfigData":{
"dimData":[
{
"key":"val1",
"text":"val1"
},
{
"key":"val2",
"text":"val2"
}
],
"measData":[
{
"key":"val3",
"text":"val3"
},
{
"key":"val4",
"text":"val4"
}
]
}
}
ありがとうございましたschnoedel。行の数が制限されているため、上からファクトリ関数オプションを使用しました。 – Deepak