$(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: false, vro: false, 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
0

SAPUI5 - Smartfield with searchhelp for country

Dec 12, 2016 at 02:43 PM

82

avatar image

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.

clipboard01.png (3.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Andy Bloem Dec 22, 2016 at 07:18 PM
0

found the problem

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

must be:

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