繁体   English   中英

SAP UI5:Header 的 OData 绑定和 PopOver 中的详细信息集

[英]SAP UI5: OData Binding for Header and Detail Set in a PopOver

我正在尝试绑定一个弹出框以根据单击的内容显示行项目数据。 我正在研究 header 和详细的 ODATA 集。 我能够显示弹出框,只是在显示单击的值时出现问题。 详情如下。 先感谢您。

我想要实现的目标:单击时在弹出窗口中显示 100000。

弹出框 Controller 代码:

viewDetails: function(oEvent) {
            
    var oEve = oEvent.getSource();
    
    var oCtx = oEvent.getSource().getParent().getBindingContext("mAggingData"); 

    if (!this._oEditAddPopover) {
        this._oEditAddPopover = sap.ui.xmlfragment("Viewcustomeroptions", "Z_AR_AGING.view.ViewCustomerOptions",
        this);  
    }

    this.getView().addDependent(this._oEditAddPopover);
    this._oEditAddPopover.bindElement(oCtx.getPath().split('/')[2]);
    this._oEditAddPopover.openBy(oEve);
},

数据路径:

rows="{ path:'mAggingData>/VendorDetails', hierarchyLevelFor : 'Heirarchy', parameters: {arrayNames:['categories']} }"

查看.xml 代码:

<Column width="8rem" id="id_level0" sortProperty="Customer" filterProperty="Customer" class="sortingProp">
    <m:Label text="Customer" id="CustomerNum"/>
    <template >
        <m:Link id="customerDetails" text="{mAggingData>Customer}" wrapping="false" class="applyRowHighlight" press="viewDetails"/>
    </template>
</Column>

查看客户选项弹出窗口 - {Customer} 未在弹出窗口中输出数据:

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<Popover id="myPopover" title="{Customer}" class="sapUiPopupWithPadding" placement="Right" initialFocus="action">
    <footer>
        <Toolbar>
            <ToolbarSpacer/>
            <Button id="action" text="View Customer Details" press="navToCustomer"/>
        </Toolbar>
    </footer>
</Popover>
</core:FragmentDefinition>

SPath的F12调试器Output

更新:

从 HeaderSet 绑定,但它仍然没有从 mAggingData > VendorDetails > 类别中给出预期的 output:

Output

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<Popover id="myPopover" title="{mAggingData>Customer}" class="sapUiPopupWithPadding" placement="Right" initialFocus="action">
    <content>
     <List id="listPopover" items = "{/CustHeadSet}">
        <StandardListItem title="{Customer}"/>
     </List>
    </content>
    <footer>
        <Toolbar>
            <ToolbarSpacer/>
            <Button id="action" text="View Customer Details" press="navToCustomer"/>
        </Toolbar>
    </footer>
</Popover>                                          
</core:FragmentDefinition>

使用 model 名称(即title="{mAggingData>Customer}" )为弹出窗口中的绑定添加前缀。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM