모의 서버를 사용하여 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입니다
내가 Key
추가 할 때 :
<EntityType Name="Equipment" BaseType="GWSAMPLE_BASIC.EquipmentBO">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.String"/>
</EntityType>
그것은 잘 작동 :
을 또한, 나는 createKey
는 또한 오류가 발생합니다 발견 :
ODataModel-dbg.js:2005 Uncaught TypeError: Cannot read property 'propertyRef' of undefined
this.getModel().createKey("EquipmentSet", {
id : "111"
});
그래서 제 질문은, 내가 변경하지 않고이 문제를 해결할 수 있습니다 내 oData 메타 데이터? 키는 이미 BaseEntityBO
에 정의되어 있습니다.
좋은 결과! SAP가이를 지원해야한다고 생각합니다. SEGW는 BaseType 구성을 지원합니다. – Allen