面板中的数据绑定

时间:2016-07-07 15:44:53

标签: javascript data-binding filter sapui5

我想将我的数据绑定到名为Bids的片段中具有ID的面板。

我的观点:

<ScrollContainer width="100%" height="75%" horizontal="true" vertical="true" focusable="false">
        <core:Fragment fragmentName="myApp.fragments.Details"   type="XML" />
        <core:Fragment type="XML" fragmentName="myApp.fragments.Bids" />            
</ScrollContainer>

我的片段

<Panel width="auto" id="BidPanel">
  <l:Grid defaultSpan="XL6 L6 M12 S12" defaultIndent="XL0 L0 M3 S0" id="BidsGrid">
    <l:VerticalLayout>
        <l:HorizontalLayout>
            <Label text="Bid ID" class="myLabel" textAlign="Right" />
            <Text id="ReverseBidId" text="{Items>BidID}" />
        </l:HorizontalLayout>
    </l:VerticalLayout>
  </l:Grid>
</Panel>

我的JS的这一部分将名为Items的Datamodel绑定到我的视图并且工作正常。

oView.bindElement({
                path : "Items>/ItemDocumentSet(guid'" + oArgs.Doid + "')",
                events : {
                    change: this._onBindingChange.bind(this),
                    dataRequested: function (oEvent) {
                        oView.setBusy(true);
                    },
                    dataReceived: function (oEvent) {
                        oView.setBusy(false);
                    }
                }
            });

但我需要使用像

这样的过滤器进行另一次绑定
var filter = new Filter("BReftoaucDoid", sap.ui.model.FilterOperator.EQ, oArgs.Doid);

我的片段部分。我不知道这样做。

这不起作用:

oView.byId("BidPanel").bindElement({
                path : "Items>/BidDocumentSet",
                filters: [filter],
                events : {
                    change: this._onBindingChange.bind(this),
                    dataRequested: function (oEvent) {
                        oView.setBusy(true);
                    },
                    dataReceived: function (oEvent) {
                        oView.setBusy(false);
                    }
                }
            });

0 个答案:

没有答案