简体   繁体   中英

Multiple odata binding sapui5

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>

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}, ie

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM