如何使用valuehelp在“智能字段”中显示名称或描述?

问题描述

我有一个这样定义的智能字段:

<smartField:SmartField value="{MarktID}" textInEditModeSource="ValueList" >
    <smartField:configuration>
        <smartField:Configuration preventInitialDataFetchInValueHelpDialog="false" displayBehaviour="idAndDescription"/>
    </smartField:configuration>
</smartField:SmartField>

它是这样呈现的(即具有值帮助的文本框):

enter image description here

因为我的注释文件中有以下定义:

<Annotations Target="Metadata.Meldungen/MarktID">
    <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>

当我打开值帮助对话框时,就像这样:

enter image description here

问题是,如何在智能字段中显示所选项目的名称。我的意思是不是要显示1300(如第一张图片所示),而是要在智能字段本身中显示1300 (Cimt Handelsgruppe)

解决方法

首先,基于this example,我需要像这样更改注释:

<Annotations Target="Metadata.Meldungen/MarktID">
    <Annotation Term="Common.Text" Path="Markt/Name">
        <Annotation Term="UI.TextArrangement" EnumMember="UI.TextArrangementType/TextLast"/>
    </Annotation>
    <Annotation Term="Common.ValueList">
        <Record>
            <PropertyValue Property="CollectionPath" String="MarktSet"/>
            <PropertyValue Property="SearchSupported" Bool="true"/>
            <PropertyValue Property="FetchValues" Int="1" />
            <PropertyValue Property="Parameters">
                <Collection>
                    <Record Type="Common.ValueListParameterInOut">
                        <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>

尽管在加载对象时它会在括号中显示名称,但是更改选定的ID后它不会显示名称,除非我对主要服务模型使用TwoWay绑定。

enter image description here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...