Smartfield annotation for showing names of the key variables does not work. Do you have any idea about it? - annotations

I implement annotation as shown is SDK, but it doesn't affect my smartfield. Still, it shows only key value. But I want to show that like 'description(key)'. Do you have any idea?
My annotation code:
<Annotations Target="xxx.xxSh/Posid">
<Annotation Term="Common.Text" Path="Post1">
<Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextLast"/>
</Annotation>
</Annotations>
<Annotations Target="xxx.xxar/Parnr">
<Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextFirst"/>
<Annotation Term="Common.ValueList">
<Record Type="Common.ValueListType">
<PropertyValue Property="CollectionPath" String="xxShSet"/>
<PropertyValue Property="SearchSupported" Bool="true"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Post1"/>
</Record>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="Parnr"/>
<PropertyValue Property="ValueListProperty" String="Posid"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
my xml code:
<smartField:SmartField value="{Parnr}" textInEditModeSource="ValueList" change="onParnrChange">
<smartField:configuration>
<smartField:Configuration preventInitialDataFetchInValueHelpDialog="false"/>
</smartField:configuration>
</smartField:SmartField>

Have you tried adding this to the xml? This will display description and Id. <smartField:configuration> <smartField:Configuration displayBehaviour="descriptionAndId"/> </smartField:configuration>

Related

SAP Fiori Elements Navigation Links Not Generated

I'm developing an application using SAP's Fiori Elements and an oData V4 service. The application is a standard List Report and Object Page. I've made several of these applications before, and always the link between the List Report and the Object page is automatically generated. However, in this case only the link is not generated. When I click a row on the List Report Page, no navigation to the Object Page is generated. I don't understand what I'm doing wrong. I suspect the issue could be related to the oData service itself, but I can't find any information about where in an oData service a Fiori Elements page might derive this link. Any advice would be appreciated.
Here is an image of the screen output:
screen ouput
Below is the relevant parts of my manifest:
{
"_version": "1.8.0",
"sap.app": {
"id": "sales",
"type": "application",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"dataSources": {
"ProjectService": {
"uri": "/api/project/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
}
},
"-sourceTemplate": {
"id": "ui5template.basicSAPUI5ApplicationProject",
"-id": "ui5template.smartTemplate",
"-version": "1.40.12"
}
},
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe.templates": {}
}
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"": {
"dataSource": "ProjectService",
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true,
"groupProperties": {
"default": {
"submit": "Auto"
}
}
}
}
},
"routing": {
"routes": [
{
"pattern": ":?query:",
"name": "SalesList",
"target": "SalesList"
},
{
"pattern": "SalesOrders({key}):?query:",
"name": "SalesDetails",
"target": "SalesDetails"
}
],
"targets": {
"SalesList": {
"type": "Component",
"id": "SalesList",
"name": "sap.fe.templates.ListReport",
"options": {
"settings": {
"entitySet": "SalesOrders",
"navigation": {
"SalesOrders": {
"detail": {
"route": "SalesDetails"
}
}
}
}
}
},
"SalesDetails": {
"type": "Component",
"id": "SalesDetails",
"name": "sap.fe.templates.ObjectPage",
"options": {
"settings": {
"entitySet": "SalesOrders"
}
}
}
}
},
"contentDensities": {
"compact": true,
"cozy": true
}
},
"sap.ui": {
"technology": "UI5",
"fullWidth": false
},
"sap.fiori": {
"registrationIds": [],
"archeType": "transactional"
}
}
EDIT:
Below is the metadata document for the service I used to generate the application.
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
<edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities"/>
</edmx:Reference>
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Common.xml">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
<edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
</edmx:Reference>
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/UI.xml">
<edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="UI"/>
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="project">
<EntityType Name="Currencies">
<Key>
<PropertyRef Name="code"/>
</Key>
<Property Name="name" Type="Edm.String" MaxLength="255"/>
<Property Name="descr" Type="Edm.String" MaxLength="1000"/>
<Property Name="code" Type="Edm.String" Nullable="false" MaxLength="3"/>
<Property Name="symbol" Type="Edm.String" MaxLength="5"/>
<NavigationProperty Name="texts" Type="Collection(project.Currencies_texts)">
<OnDelete Action="Cascade"/>
</NavigationProperty>
<NavigationProperty Name="localized" Type="project.Currencies_texts">
<ReferentialConstraint Property="code" ReferencedProperty="code"/>
</NavigationProperty>
</EntityType>
<EntityType Name="Currencies_texts">
<Key>
<PropertyRef Name="locale"/>
<PropertyRef Name="code"/>
</Key>
<Property Name="locale" Type="Edm.String" Nullable="false" MaxLength="14"/>
<Property Name="name" Type="Edm.String" MaxLength="255"/>
<Property Name="descr" Type="Edm.String" MaxLength="1000"/>
<Property Name="code" Type="Edm.String" Nullable="false" MaxLength="3"/>
</EntityType>
<EntityType Name="POrders">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Guid" Nullable="false"/>
<Property Name="createdAt" Type="Edm.DateTimeOffset" Precision="7"/>
<Property Name="createdBy" Type="Edm.String" MaxLength="255"/>
<Property Name="modifiedAt" Type="Edm.DateTimeOffset" Precision="7"/>
<Property Name="modifiedBy" Type="Edm.String" MaxLength="255"/>
<Property Name="OrderNo" Type="Edm.String"/>
<Property Name="total" Type="Edm.Decimal" Precision="9" Scale="2"/>
<Property Name="currency_code" Type="Edm.String" MaxLength="3"/>
<NavigationProperty Name="currency" Type="project.Currencies">
<ReferentialConstraint Property="currency_code" ReferencedProperty="code"/>
</NavigationProperty>
</EntityType>
<EntityType Name="PurchaseOrderItems">
<Key>
<PropertyRef Name="EBELN"/>
<PropertyRef Name="EBELP"/>
</Key>
<Property Name="EBELN" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="EBELP" Type="Edm.String" Nullable="false" MaxLength="5"/>
<Property Name="MATNR" Type="Edm.String" MaxLength="40"/>
<Property Name="WERKS" Type="Edm.String" MaxLength="4"/>
</EntityType>
<EntityType Name="PurchaseOrders">
<Key>
<PropertyRef Name="EBELN"/>
</Key>
<Property Name="EBELN" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="BUKRS" Type="Edm.String" MaxLength="4"/>
<Property Name="BEDAT" Type="Edm.Date"/>
<Property Name="STATU" Type="Edm.String" MaxLength="1"/>
<NavigationProperty Name="Items" Type="Collection(project.PurchaseOrderItems)">
<OnDelete Action="Cascade"/>
</NavigationProperty>
</EntityType>
<EntityType Name="SalesOrderItems">
<Key>
<PropertyRef Name="POSNR"/>
<PropertyRef Name="VBELN"/>
</Key>
<Property Name="POSNR" Type="Edm.String" Nullable="false" MaxLength="6"/>
<Property Name="VBELN" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="MATNR" Type="Edm.String" MaxLength="40"/>
<Property Name="MEINS" Type="Edm.String" MaxLength="3"/>
<Property Name="ZMENG" Type="Edm.String" MaxLength="20"/>
<Property Name="NETPR" Type="Edm.String" MaxLength="20"/>
<Property Name="WAERK" Type="Edm.String" MaxLength="5"/>
</EntityType>
<EntityType Name="SalesOrders">
<Key>
<PropertyRef Name="VBELN"/>
</Key>
<Property Name="VBELN" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="AUDAT" Type="Edm.Date"/>
<Property Name="AUART" Type="Edm.String" MaxLength="4"/>
<Property Name="KUNNR" Type="Edm.String" MaxLength="10"/>
<NavigationProperty Name="Items" Type="Collection(project.SalesOrderItems)">
<OnDelete Action="Cascade"/>
</NavigationProperty>
</EntityType>
<EntityContainer Name="EntityContainer">
<EntitySet Name="Currencies" EntityType="project.Currencies">
<NavigationPropertyBinding Path="texts" Target="Currencies_texts"/>
<NavigationPropertyBinding Path="localized" Target="Currencies_texts"/>
</EntitySet>
<EntitySet Name="Currencies_texts" EntityType="project.Currencies_texts"/>
<EntitySet Name="POrders" EntityType="project.POrders">
<NavigationPropertyBinding Path="currency" Target="Currencies"/>
</EntitySet>
<EntitySet Name="PurchaseOrderItems" EntityType="project.PurchaseOrderItems"/>
<EntitySet Name="PurchaseOrders" EntityType="project.PurchaseOrders">
<NavigationPropertyBinding Path="Items" Target="PurchaseOrderItems"/>
</EntitySet>
<EntitySet Name="SalesOrderItems" EntityType="project.SalesOrderItems"/>
<EntitySet Name="SalesOrders" EntityType="project.SalesOrders">
<NavigationPropertyBinding Path="Items" Target="SalesOrderItems"/>
</EntitySet>
</EntityContainer>
<Annotations Target="project.Currencies">
<Annotation Term="UI.Identification">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Value">
<Path>name</Path>
</PropertyValue>
</Record>
</Collection>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies/name">
<Annotation Term="Common.Label">
<String>Name</String>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies/descr">
<Annotation Term="Common.Label">
<String>Description</String>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies/code">
<Annotation Term="Common.Label">
<String>Currency Code</String>
</Annotation>
<Annotation Term="Common.Text">
<Path>name</Path>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies/symbol">
<Annotation Term="Common.Label">
<String>Currency Symbol</String>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies_texts/name">
<Annotation Term="Common.Label">
<String>Name</String>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies_texts/descr">
<Annotation Term="Common.Label">
<String>Description</String>
</Annotation>
</Annotations>
<Annotations Target="project.Currencies_texts/code">
<Annotation Term="Common.Label">
<String>Currency Code</String>
</Annotation>
<Annotation Term="Common.Text">
<Path>name</Path>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/ID">
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/createdAt">
<Annotation Term="Common.Label">
<String>Created On</String>
</Annotation>
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
<Annotation Term="Core.Immutable">
<Bool>true</Bool>
</Annotation>
<Annotation Term="UI.HiddenFilter">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/createdBy">
<Annotation Term="Common.Label">
<String>Created By</String>
</Annotation>
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
<Annotation Term="Core.Description">
<String>User's unique ID</String>
</Annotation>
<Annotation Term="Core.Immutable">
<Bool>true</Bool>
</Annotation>
<Annotation Term="UI.HiddenFilter">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/modifiedAt">
<Annotation Term="Common.Label">
<String>Changed On</String>
</Annotation>
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
<Annotation Term="UI.HiddenFilter">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/modifiedBy">
<Annotation Term="Common.Label">
<String>Changed By</String>
</Annotation>
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
<Annotation Term="Core.Description">
<String>User's unique ID</String>
</Annotation>
<Annotation Term="UI.HiddenFilter">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/OrderNo">
<Annotation Term="Common.FieldControl">
<EnumMember>Common.FieldControlType/Mandatory</EnumMember>
</Annotation>
<Annotation Term="Common.Label">
<String>Order Number</String>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/total">
<Annotation Term="Core.Computed">
<Bool>true</Bool>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/currency">
<Annotation Term="Common.Label">
<String>Currency</String>
</Annotation>
<Annotation Term="Core.Description">
<String>Currency code as specified by ISO 4217</String>
</Annotation>
</Annotations>
<Annotations Target="project.POrders/currency_code">
<Annotation Term="Common.Label">
<String>Currency</String>
</Annotation>
<Annotation Term="Common.ValueList">
<Record Type="Common.ValueListType">
<PropertyValue Property="Label">
<String>Currency</String>
</PropertyValue>
<PropertyValue Property="CollectionPath">
<String>Currencies</String>
</PropertyValue>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty">
<PropertyPath>currency_code</PropertyPath>
</PropertyValue>
<PropertyValue Property="ValueListProperty">
<String>code</String>
</PropertyValue>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty">
<String>name</String>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Core.Description">
<String>Currency code as specified by ISO 4217</String>
</Annotation>
</Annotations>
<Annotations Target="project.EntityContainer/SalesOrders">
<Annotation Term="Capabilities.DeleteRestrictions">
<Record Type="Capabilities.DeleteRestrictionsType">
<PropertyValue Property="Deletable">
<Bool>false</Bool>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Capabilities.InsertRestrictions">
<Record Type="Capabilities.InsertRestrictionsType">
<PropertyValue Property="Insertable">
<Bool>false</Bool>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="Capabilities.UpdateRestrictions">
<Record Type="Capabilities.UpdateRestrictionsType">
<PropertyValue Property="Updatable">
<Bool>false</Bool>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>

Cannot select the value from the Select list by keyboard when it is generated via smart fields

I have defined a smart form with some smart fields. One of my smart fields is a Select:
<smartForm:GroupElement>
<smartField:SmartField value="{Trade}" id="smartFieldTrade" textInEditModeSource="ValueList" mandatory="false">
<smartField:configuration>
<smartField:Configuration preventInitialDataFetchInValueHelpDialog="false" displayBehaviour="idAndDescription" controlType="selection"/>
</smartField:configuration>
</smartField:SmartField>
</smartForm:GroupElement>
This element has the following entry in the annotation file:
<Annotations Target="Metadata.DamageReport/TrashContainer">
<Annotation Term="Common.Text" Path="TrashContainertxt">
<Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextOnly"/>
</Annotation>
<Annotation Term="Common.ValueListWithFixedValues" Bool="true"/>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="CollectionPath" String="TrashContainerHelpSet"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterInOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="TrashContainer"/>
<PropertyValue Property="ValueListProperty" String="Id"/>
</Record>
<Record Type="Common.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="TrashContainertxt"/>
<PropertyValue Property="ValueListProperty" String="Name"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
The problem is in the WebIDE, I can select the values of this select by mouse or keyboard. However, after deploying in the SAP ABAP Repository, when I open the select by mouse and try to select the value by keyboard, the value does not set!
Here the first time value has been selected by mouse and 302 is set, but later with keyboard I cannot set 301 or 303! You can see the value will return back to 302 after pressing the enter on my keyboard.

Smart fields that are rendered as drop down does not show description

I have a smart field that I defined like this:
<smartField:SmartField value="{MarktID}" textInEditModeSource="ValueList" >
<smartField:configuration>
<smartField:Configuration preventInitialDataFetchInValueHelpDialog="false" displayBehaviour="idAndDescription"/>
</smartField:configuration>
</smartField:SmartField>
it's rendered like this (i.e. as drop down or select):
because I have this definition in my annotation file:
<Annotations Target="Metadata.Meldungen/MarktID">
<Annotation Term="Common.ValueListWithFixedValues" Bool="true"/>
<Annotation Term="Common.ValueList">
<Record>
<PropertyValue Property="CollectionPath" String="MarktSet"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="Common.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="MarktID"/>
<PropertyValue Property="ValueListProperty" String="ID"/>
</Record>
<Record Type="Common.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Name"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
The question is how can I show the name of the selected item also in the drop down. I mean instead of showing 1300 (1300) (as can be seen in the picture) I want to show 1300 (Cimt Handelsgruppe) in the drop down itself.
It seems at the moment it does not know what to show in the parenthesis!?
Eventually I found the solution!
Here is the definition of entity that contains the data regarding the drop-down:
<EntityType Name="Markt" sap:content-version="1">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.String" Nullable="false" MaxLength="4" sap:display-format="UpperCase" sap:label="ID" sap:text="Name"/>
<Property Name="Name" Type="Edm.String" Nullable="false" sap:label="Name"/>
</EntityType>
What was missing in my definition was sap:text="Name". By adding this small property the smart field know it has to show which property as description when the displayBehaviour is equal idAndDescription or descriptionAndId.
Finally I had what I wanted:

How to prevent multi selection on SmartFilterBar?

I have the following SmartFilterBar:
As you can see on the input field, multi selection is possible. How can I prevent multi selection on the field?
I tried:
<smartFilterBar:ControlConfiguration key="ClassType" filterType="smartFilterBar:FilterType.single" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="ClassNum" filterType="smartFilterBar:FilterType.single" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"></smartFilterBar:ControlConfiguration>
But it does not work.
There is an annotation which controls this.
See this.
<Annotation Term="com.sap.vocabularies.Common.v1.FilterExpressionRestrictions" >
<Collection>
<Record>
<PropertyValue Property="Property" PropertyPath="Customer" />
<PropertyValue Property="AllowedExpressions" EnumMember="com.sap.vocabularies.Common.v1.FilterExpressionType/SingleValue" />
</Record>
<Record>
<PropertyValue Property="Property" PropertyPath="CompanyCode" />
<PropertyValue Property="AllowedExpressions" EnumMember="com.sap.vocabularies.Common.v1.FilterExpressionType/SingleValue" />
</Record>
</Collection>
Refer https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.comp.smartfilterbar.SmartFilterBar/annotations/Summary and search for 'FilterExpressionType' for more detail.

No Data coming in SmartTable

I am trying to call the OData service with Smart Table. First I created a simple table and with that I am can see the data in table. Then I added SmartTable on the same page but It is showing no data. Even no columns are being created. What could be the reason ?
<mvc:View controllerName="com.siemens.hc.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" xmlns:smartField="sap.ui.comp.smartfield" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"
xmlns:smartTable="sap.ui.comp.smarttable">
<App>
<pages>
<Page title="{i18n>title}">
<content>
<Table id="idProductsTable" inset="false" items="{/SafetyUpdateSet}">
<headerToolbar>
<Toolbar>
<Title text="Product" level="H2"/>
</Toolbar>
</headerToolbar>
<columns>
<Column width="12em">
<Text text="Product"/>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<ObjectIdentifier title="{Notification}"/>
</cells>
</ColumnListItem>
</items>
</Table>
<smartTable:SmartTable id="smartTable_ResponsiveTable" tableType="ResponsiveTable" editable="false" entitySet="SafetyUpdateSet"
useVariantManagement="false" useTablePersonalisation="false" header="Notification" showRowCount="true" useExportToExcel="false"
enableAutoBinding="true">
</smartTable:SmartTable>
</content>
</Page>
</pages>
</App>
</mvc:View>
I have created the destination in neo-app.json file and created the model in Manifest.json file.
Regards,
Mayank
I had to defined the columns Manually in my SmartTable.
<smartTable:SmartTable id="smartTable_ResponsiveTable" tableType="ResponsiveTable" editable="false" entitySet="EntitySet"
useVariantManagement="false" useTablePersonalisation="false" header="Notification" showRowCount="true" useExportToExcel="false"
enableAutoBinding="true" initiallyVisibleFields="Col1,Col2,Col3,Col4,Col5"></smartTable:SmartTable>
You have a model named "invoice". According to the documentation named models are not supported by smart controls.
You can also use an annotation file, provided your oData service supports annotations. Create a new annotation file, annotate the entity set, and add LineItem/DataField annotations. That should display the fields you selected.
<Annotations Target="<oData.Service>">
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Field1"/>
<PropertyValue Property="Label" String="{i18n>Field1Label}"/>
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Field2"/>
<PropertyValue Property="Label" String="{i18n>Field2Label}"/>
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Field3"/>
<PropertyValue Property="Label" String="{i18n>Field3Label}"/>
</Record>
</Collection>
</Annotation>
</Annotations>
You can leave out the 'label' properties if you oData field names are to your liking.
I just faced this error.
This may be resolved by adding
xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
at the top of view. Although I could not find any reason/explanation of adding this, but I believe this is related to FlexItemData.