複数のエンティティタイプのデータを表示するxmlビューがあります(テーブルには両方のタイプの共通フィールドのみが表示されます)。 テーブル全体を動的にフィルタリングしたいので、手動で2つのバインディングを設定し、必要に応じてそれらをフィルタリングし、各フィルタ処理後に対応するテーブルモデルを再構築します。SapUi5で手作業でバインディングを作成するには?
しかし、私のバインディングは正しく機能しません。つまり、データを受け取ったり、フィルタリングしたりすることができません。
this.workOrderBinding = new Binding(this.getView().getModel(),)"/WorkOrderSet"); //Binding is of type sap.ui.model.odata.v2.ODataListBinding
this.issueNoticeBinding = new Binding(this.getView().getModel(), "/IssueNoticeSet"); //Binding is of type sap.ui.model.odata.v2.ODataListBinding
this.workOrderBinding.attachDataReceived(function() {
var tempModel = new JSONModel();
tempModel.setData({
WorkOrderSet: this.workOrderBinding.getModel().getData()
}, true);
tempModel.setData({
WorkOrderSet: this.issueNoticeBinding.getModel().getData()
}, true);
this.getView().byId("table").setModel(tempModel);
}, this);
this.getView().getModel()
はmanifest.jsonをで定義されたグローバルODataModelを返す:controller.jsで
。