首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SAPUI5多聚合绑定

SAPUI5多聚合绑定
EN

Stack Overflow用户
提问于 2018-07-13 16:34:40
回答 0查看 854关注 0票数 0

作为初始数据集,我有一个可以有多个子列表的XML列表。此列表应使用SAPUI5动态设置。1.第一个列表应该是一个SAPUI5列表,其中应该显示名称。2.然后选择值应该显示为SAPUI5 SegmentedButtons。3.当用户按下SegmentedButton的最后一个按钮时,会有一个下拉列表显示匹配的子值。

我在XML.view中完成了前两点。这很好用。但是我没有填好下拉列表。如何填充下拉列表?

此外,还有两种不同的类型。如果类型是“定性的”,用户将显示SegmentedButtons。如果它是“定量”类型,用户只会得到一个空的输入字段。

See here for Sample Image

数据集

代码语言:javascript
复制
<?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

代码语言:javascript
复制
<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>
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51320983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档