cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 - Smartfield with searchhelp for country

Former Member
0 Kudos

Hi Experts,

I want to create a searchhelp on a smartfield for country.

in the metadata.xml I have this:

<EntityContainer Name="/IWBEP/GWSAMPLE_BASIC_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
                <EntitySet Name="ContactSet" EntityType="/IWBEP/GWSAMPLE_BASIC.Contact" sap:content-version="1"/>
                <EntitySet Name="VH_CountrySet" EntityType="/IWBEP/GWSAMPLE_BASIC.VH_Country" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1"/>

and the annotation:

<Annotations Target="/IWBEP/GWSAMPLE_BASIC.Contact/Address/Country"
xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
<Record>
<PropertyValue Property="Label" String="VH_CountrySet" />
<PropertyValue Property="CollectionPath" String="VH_CountrySet" />
<PropertyValue Property="SearchSupported" Bool="true" />
<PropertyValue Property="Parameters">
<Collection>
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty"
PropertyPath="Address/Country" />
<PropertyValue Property="ValueListProperty"
String="Land1" />
</Record>
<Record
Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty"
String="Landx" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>

the view:

<form:SimpleForm title="SimpleForm" minWidth="1024" maxContainerCols="2" editable="true" layout="ResponsiveGridLayout" labelSpanL="3" labelSpanM="3"
emptySpanL="4" emptySpanM="4" columnsL="1" columnsM="1">
<form:content>
<smartField:SmartLabel labelFor="country"/>
<smartField:SmartField value="{Address/Country}" id="country"/>
</form:content>
</form:SimpleForm>

odata:

Address: {__metadata: {type: "/IWBEP/GWSAMPLE_BASIC.CT_Address"
},City: "Rome",
PostalCode: "00185",
Street: "Via San Martino della Battaglia",
Building: "63",
Country: "IT",
AddressType: "02"
},ContactGuid: "005056A2-16B8-1ED6-AFFE-318BDBE27B97",
BusinessPartnerID: "0100000025",
Title: "",
FirstName: "Alessio",
MiddleName: "",
LastName: "Galasso",
Nickname: "",
Initials: "",
PhoneNumber: "4580963184",
FaxNumber: "4580963004",
EmailAddress: "alessio.galasso@tcdr.it",
Language: "EN",
DateOfBirth: null}

but, I don't see the seahhelp....

the binding works.

Does anyone knows what is wrong in the code?

KR.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

found the problem

<Annotations Target="/IWBEP/GWSAMPLE_BASIC.Contact/Address/Country"

must be:

<Annotations Target="/IWBEP/GWSAMPLE_BASIC.Address/Country"