1
votes

im new with sapui5

I have a problem binding two diferent odata models to a single xml.view. (one default model, the second one modelHana)

both odata models bind to the view if there not used together on the same view.

i declare the odata source and the model in the manifest.json.

when i try binding the second model to the view.XML,

using the modelname>/entity structure to bind, it displays a long blank list in the combobox.

is there any procedure to bind apart from the one mentioned in this url: its pretty straight foward , but it just doesnt seem to work.

https://blogs.sap.com/2017/02/28/add-more-than-one-odata-service-in-your-sapui5-application-using-sap-webide/

like i mentioned before ,using any of the two models as default (without {modelname>/entity}, works.

( i´ve also tryed in the item key using modelHana>/FODepartment/cust_typeDepartment and same for name)

       <ComboBox
            id="Sucursal"items="{ path: 'modelHana>/FODepartment',
                sorter: { path: 'cust_typeDepartment' }}">

            <core:Item key="{cust_typeDepartment}" text="{name}" />
        </ComboBox>
    </InputListItem>
1

1 Answers

2
votes

When using aggregation binding for a named model, you also need to prefix the property binding path on item level with your model name.

Instead of having {cust_typeDepartment}, use {modelHana>cust_typeDepartment}, i.e.

<core:Item key="{modelHana>cust_typeDepartment}" text="{modelHana>name}" />