List Binding is not bound against a list for XSODATA service

618 views Asked by At

I have dropdown list, this consume a xsodata service in my app SAP UI5. This service working in local mode in SAP Web IDE Rest Full, in the deploy proccess I haven't error but when I test my app deployed the dropdown list not working and I get a error in console.

List Binding is not bound against a list for /MyEntity

When I clic in the dropdown list I get this message:

cdm.js:68 Assertion failed: Type for filter property could not be found in metadata!

It's as if the service xsodata doesn't exist.

PS: This app was deployed in sap cloud foundry.

UPDATE:

My_controller.js

    onInit: function () {
    
    oModelHana = new sap.ui.model.odata.ODataModel("xsodata/ServiceHana.xsodata", true);
    
    this.oSelEntity = this.byId("inMyDropdown");
    this.oSelEntity.setModel(oModelHana);
}

And my_view.xml

...
<Label text="Entity"/>
<Select id="inMyDropdown" maxWidth="300rem" items="{/Entity}">
    <c:Item key="{EntityID}" text="{description}"/>
</Select>
...

Please, can you help me?

1

There are 1 answers

0
A.vH On

What kind of Odata-Service are you using?

sap.ui.model.odata.ODataModel is deprecated since UI5 1.48

So you have to decide between

sap.ui.model.odata.v2.ODataModel

and

sap.ui.model.odata.v4.ODataModel

And why don't you define the Model directly in the manifest.json?

manifest.json

"dataSources": {
            "xsodataService": {
                "uri": "/xsodata/ServiceHana.xsodata/",
                "type": "OData",
                "settings": {
                    "odataVersion": "4.0"
                }
            },


"models": {
            
            "": {
                "dataSource": "xsodataService",
                "settings": {
                    "synchronizationMode": "None",
                    "operationMode": "Server",
                    "groupId": "$auto",
                    "autoExpandSelect" : true,
                    "earlyRequests": true,
                    "groupProperties": {
                        "default": {
                            "submit": "Auto"
                        }
                    }
                }
            },