简体   繁体   English

多个odata绑定sapui5

[英]Multiple odata binding sapui5

im new with sapui5 我是sapui5的新手

I have a problem binding two diferent odata models to a single xml.view. 我在将两个不同的odata模型绑定到单个xml.view时遇到问题。 (one default model, the second one modelHana) (一个默认模型,第二个默认模型Hana)

both odata models bind to the view if there not used together on the same view. 如果两个odata模型未在同一视图上一起使用,则它们都将绑定到该视图。

i declare the odata source and the model in the manifest.json. 我在manifest.json中声明了odata源和模型。

when i try binding the second model to the view.XML, 当我尝试将第二个模型绑定到view.XML时,

using the modelname>/entity structure to bind, it displays a long blank list in the combobox. 使用modelname> / entity结构进行绑定,它将在组合框中显示一个长长的空白列表。

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. 除了此url中提到的程序以外,是否有任何程序可以绑定:它非常简单,但是似乎不起作用。

https://blogs.sap.com/2017/02/28/add-more-than-one-odata-service-in-your-sapui5-application-using-sap-webide/ 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. 就像我之前提到的,使用两个模型中的任何一个作为默认模型(不使用{modelname> / entity},都可以。

( i´ve also tryed in the item key using modelHana>/FODepartment/cust_typeDepartment and same for name) (我也使用modelHana> / FODepartment / cust_typeDepartment尝试了项目键,并且名称相同)

       <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 代替使用{cust_typeDepartment},而使用{modelHana> cust_typeDepartment},即

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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