作为初始数据集,我有一个可以有多个子列表的XML列表。此列表应使用SAPUI5动态设置。1.第一个列表应该是一个SAPUI5列表,其中应该显示名称。2.然后选择值应该显示为SAPUI5 SegmentedButtons。3.当用户按下SegmentedButton的最后一个按钮时,会有一个下拉列表显示匹配的子值。
我在XML.view中完成了前两点。这很好用。但是我没有填好下拉列表。如何填充下拉列表?
此外,还有两种不同的类型。如果类型是“定性的”,用户将显示SegmentedButtons。如果它是“定量”类型,用户只会得到一个空的输入字段。
数据集
<?xml version="1.0" encoding="UTF-8"?>
<Rowsets>
<Rowset>
<Row>
<Name>Taste</Name>
<Type>qualitative</Type>
<ID>1</ID>
<Selection>
<Row><Value>good</Value></Row>
<Row><Value>acceptable</Value></Row>
<Row><Value>unacceptable</Value></Row>
</Selection>
</Row>
<Row>
<Name>Smell</Name>
<Type>qualitative</Type>
<ID>2</ID>
<Selection>
<Row><Value>good</Value></Row>
<Row><Value>unacceptable</Value>
<Selection>
<Row><Subvalue>like fish</Subvalue></Row>
<Row><Subvalue>like socks</Subvalue></Row>
</Selection>
</Row>
</Selection>
</Row>
<Row>
<Name>Weight</Name>
<Type>quantitative</Type>
<ID>3</ID>
</Row>
<Row>
<Name>Appearance</Name>
<Type>qualitative</Type>
<ID>4</ID>
<Selection>
<Row><Value>good</Value></Row>
<Row><Value>acceptable</Value></Row>
</Selection>
</Row>
</Rowset>
</Rowsets>main.view.xml
<List
id="List"
headerText="List"
items="{Result>/Rowset/Row/}" >
<InputListItem label="{Result>Name}">
<SegmentedButton selectedButton="none" items="{Result>Selection/Row/}" visible="{= ${Result>Type} === 'qualitative' }">
<items>
<SegmentedButtonItem key="{Result>Value}" text="{Result>Value}" />
</items>
</SegmentedButton>
<Select
visible="{= ${Result>Type} === 'qualitative' }"
items="{Result>Selection/Row/Selection/Row/}">
<core:Item key="{Result>Subvalue}" text="{Result>Subvalue}" />
</Select>
<Input value="" visible="{= ${Result>Type} === 'quantitative' }" />
</InputListItem>https://stackoverflow.com/questions/51320983
复制相似问题