on 06-23-2018 2:20 PM
My view View1's Object attribute is currently binded with "test_srv/testlist1/personal number". In the same view (View1) I have added another Object attribute and that should be binded with "test_srv/testlist2/personal number". could some one provide a snippet to bind the elements from a different collections in the same view? Many thanks for your response.
Thanks
I have lost touch with UI5 development but I can suggest you to try this.
1. On the onInit function of controller, create and load two named json models. Example-
//model for storing approvers for the request
this._oApproverModel = new JSONModel({ Approvers: [] });
// Set the named model
this.getView().setModel(this._oApproverModel, "approverModel");
//model for print options for the request
this._oPrintModel = new JSONModel({ PrintOptions: [] });
// Set another named model
this.getView().setModel(this._oPrintModel, "printModel");
2. Instead of single view, I did similar thing(binding two named json models) on multiple fragments instantiated from same view.
(It's difficult to provide this code as it is split across multiple Utility functions)
3. Fragment binding code -
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <Popover showHeader="false" placement="Auto"> <content> <List items="{approverModel>/Approvers}"> <items> <ObjectListItem title="{= ${approverModel>ApproverName} + ' (' + Math.round(${approverModel>ApproverId}) + ')'}" > </ObjectListItem> </items> </List> </content> </Popover> </core:FragmentDefinition>
BR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.