on 2015 Jul 08 9:19 AM
Request clarification before answering.
Looking at your structure, I think the binding path for aggregation 'items' should be {/d/results}
However, it seems like you stored OData response in an JSONModel. Why not use an ODataModel instead?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Impossible, it should be working.
But you do have assigned the controller AND the model to your SelectDialog upon opening, right?
showDialog : function(oEvent) {
if (! this._oDialog) {
this._oDialog = sap.ui.xmlfragment("my.demo.fragments.SelectDialog", this);
this._oDialog.setModel(this.getView().getModel());
}
this._oDialog.open();
}
Edit: Well, why not an ODataModel? If you're working with OData, I would assume it makes more sense using an ODataModel
See this working demo: Plunker
Thanks robin it's woked. Wrong line is
sap.ui.getCore().setModel(oModel); // Wrong
this.getView().setModel(oModel); // True
Robin, btw, instead of
this._oDialog = sap.ui.xmlfragment("my.demo.fragments.SelectDialog", this);
this._oDialog.setModel(this.getView().getModel());
i would do
this._oDialog = sap.ui.xmlfragment("my.demo.fragments.SelectDialog", this);
this.getView().addDependent(this._oDialog);
addDependent will propagate all the models and binding contexts (especially handy when you have more than one model) and when the view is destroyed by
sap.ui.core.UIComponent.prototype.destroy.apply(this, arguments);
that aggregation will be destroyed too, that is especially useful when component is embedded into FLP and user relaunches the app from tile. Without addDependent we would need to destroy _oDialog explicitly in destroy method of component or by second launch sap.ui.xmlfragment will throw the duplicate ID exception (because _oDialog is still in the core which is still the same for FLP)
IF you are using SAP Gateway then in place of Path put entitySet name.
Let's suppose from this link this is my JSON URL.
http://services.odata.org/V4/Northwind/Northwind.svc/Products?$format=json
then i will write /value in place of my path.
value: [
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
30 | |
9 | |
9 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.