on 09-17-2014 4:34 PM
HI Experts,
I have created a gateway service and when I test the service in the gateway client in SAP gui it works fine.
But when I try to create omodel, no bindings are available...
var oModel = new sap.ui.model.odata.ODataModel(
"/sap/opu/odata/XXX_srv");
In the javascript debugger there are no bindings...
Thanks for your support.
Best regards,
Christoph
Ok, did you check if the service works if you call it directly in the browser ("http://<server>:<port>/<path to service>")? If that works, than the relative path should be ok, if you have deployed the UI5 app to the ABAP UI5 repository (BSP app ;-)).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christoph,
the customer namespace is just a part of the path. So if you would have a service called /abc/test_service, than the service should be available as /sap/opu/odata/abc/test_service. You can see that also in transaction SICF.
So from the information I have I would assume that it should work. To which controls you bound the data from the model, so that you have seen that there is "no binding"?
Regards,
Florian
Are you running the SAPUI5 code and the odata from the server? It could be that you have a same origin (cross domain) issue?
Regards,
Jason
Hi all,
ok after the call of:
sap.ui.getCore().setModel(oModel) - the binding is visible.
But the value is not set correct..
I set the binding to the Numeric Content:
<NumericContent xmlns="sap.suite.ui.commons"
size="Auto" value="{/MAINSet('1')/PROP_NAME}"
scale="" valueColor="Neutral" indicator="" state="Loaded"
animateTextChange="true" formatterValue="false"
truncateValueTo="4" icon="" press="">
</NumericContent>
Best,
Christoph
Hi Christoph,
the problem is that you cannot bind the single record of the collection to the numeric content.
Following a little example I created yesterday which displays a numeric information via numeric content by using a JSONModel which is filled by oDataModel.read.
Controller
onInit: function() {
var oDataModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/V2/OData/OData.svc", true);
oDataModel.read("/Products(1)",
null,
null,
true,
this.modelReadSuccess
);
},
modelReadSuccess: function(oResult, response){
var oJSONModel = new sap.ui.model.json.JSONModel(oResult);
sap.ui.getCore().setModel(oJSONModel);
},
View (as in your example, just changed the value information)
<content> | ||||
<NumericContent xmlns="sap.suite.ui.commons" | ||||
size="Auto" value="{/Rating}" | ||||
scale="" valueColor="Neutral" indicator="" state="Loaded" | ||||
animateTextChange="true" formatterValue="false" | ||||
truncateValueTo="4" icon="" press=""> | ||||
</NumericContent> | ||||
</content> |
The service I used is a well known free example. But if you try it with the service, please consider to disable web-security if you are using chrome.
Regards,
Florian
Hi Christoph,
is your path correct? By default the services are located in "/sap/opu/odata/sap/XXX_srv".
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.