呈现为下拉的智能字段不显示描述 [英] 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>
问题是如何在下拉列表中显示所选项目的名称.我的意思是不想显示 1300 (1300)
(如图所示),我想在下拉菜单中显示 1300 (Cimt Handelsgruppe)
.
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>
我的定义中缺少的是sap:text=Name"
.通过添加这个小属性,智能字段知道它必须在 displayBehaviour
等于 idAndDescription
或 descriptionAndId<时将哪个属性显示为
description
/代码>.
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:
这篇关于呈现为下拉的智能字段不显示描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!