sapui5 - Data binding not working in oData BaseType -


i'm trying binding odata list using mock server.

my metadata.xml is

<edmx:edmx     xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"     version="1.0">     <edmx:dataservices m:dataserviceversion="2.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">         <schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" namespace="gwsample_basic" xml:lang="en">             <entitytype name="equipment" basetype="gwsample_basic.equipmentbo">             </entitytype>                <entitycontainer name="defaultcontainer" m:isdefaultentitycontainer="true">                 <entityset name="equipmentset" entitytype="gwsample_basic.equipment"/>             </entitycontainer>             <entitytype name="equipmentbo" basetype="gwsample_basic.baseentitybo">                 <property name="code" type="edm.string" nullable="true"></property>             </entitytype>             <entitytype name="baseentitybo" abstract="true">                 <key>                     <propertyref name="id"></propertyref>                 </key>                 <property name="id" type="edm.string"/>             </entitytype>         </schema>     </edmx:dataservices> </edmx:edmx>    

equipment.json:

[   {     "id": "1"   },   {     "id": "2"   },   {     "id": "3"   } ] 

but appear this:

enter image description here

when add key:

<entitytype name="equipment" basetype="gwsample_basic.equipmentbo">     <key>         <propertyref name="id"/>     </key>     <property name="id" type="edm.string"/> </entitytype>  

it works fine:

enter image description here

also, found createkey produce error:

odatamodel-dbg.js:2005 uncaught typeerror: cannot read property 'propertyref' of undefined

this.getmodel().createkey("equipmentset", {     id :  "111" }); 

so question is, can fix without changing odata metadata? key defined in baseentitybo.

this question duplicate of openui5 issue #951.

unfortunately datajs, odata library using in sapui5, not support derived entity types. used feature, there no plans support this.

it seems problem can solved backend service.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -