2017-09-11 1 views
0

모의 서버를 사용하여 oData를 내 List에 바인딩하려고합니다.oData에서 데이터 바인딩이 작동하지 않습니다. BaseType

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

그러나 다음과 같이 나타납니다 :

내 metadata.xml은

<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입니다

enter image description here

내가 Key 추가 할 때 :

을 16,
<EntityType Name="Equipment" BaseType="GWSAMPLE_BASIC.EquipmentBO"> 
    <Key> 
     <PropertyRef Name="id"/> 
    </Key> 
    <Property Name="id" Type="Edm.String"/> 
</EntityType> 

그것은 잘 작동 :

enter image description here

을 또한, 나는 createKey는 또한 오류가 발생합니다 발견 :

ODataModel-dbg.js:2005 Uncaught TypeError: Cannot read property 'propertyRef' of undefined

this.getModel().createKey("EquipmentSet", { 
    id : "111" 
}); 

그래서 제 질문은, 내가 변경하지 않고이 문제를 해결할 수 있습니다 내 oData 메타 데이터? 키는 이미 BaseEntityBO에 정의되어 있습니다.

답변

1

이 질문은 openui5 문제 #951과 중복됩니다.

Unfortunately datajs, the OData library we are using in SAPUI5, does not support derived entity types. As it is a rarely used feature, there currently are no plans to support this.

이 문제는 백엔드 서비스에서만 해결할 수 있습니다.

+1

좋은 결과! SAP가이를 지원해야한다고 생각합니다. SEGW는 BaseType 구성을 지원합니다. – Allen

관련 문제