$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: true, vro: true, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content

SAPUI5 - Smartfield with searchhelp for country

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"
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
<PropertyValue Property="Label" String="VH_CountrySet" />
<PropertyValue Property="CollectionPath" String="VH_CountrySet" />
<PropertyValue Property="SearchSupported" Bool="true" />
<PropertyValue Property="Parameters">
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty"
PropertyPath="Address/Country" />
<PropertyValue Property="ValueListProperty"
String="Land1" />
<PropertyValue Property="ValueListProperty"
String="Landx" />

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">
<smartField:SmartLabel labelFor="country"/>
<smartField:SmartField value="{Address/Country}" id="country"/>


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?


clipboard01.png (3.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 22, 2016 at 07:18 PM

    found the problem

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

    must be:

    <Annotations Target="/IWBEP/GWSAMPLE_BASIC.Address/Country"
    Add comment
    10|10000 characters needed characters exceeded