on 12-12-2016 2:43 PM - last edited on 02-03-2024 7:11 PM by postmig_api_4
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.
found the problem
<Annotations Target="/IWBEP/GWSAMPLE_BASIC.Contact/Address/Country"
must be:
<Annotations Target="/IWBEP/GWSAMPLE_BASIC.Address/Country"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.