如何使用 valuehelp 在智能字段中显示名称或描述? [英] How to show the name or description in Smart Fields with valuehelp?

查看:58
本文介绍了如何使用 valuehelp 在智能字段中显示名称或描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

</smartField:配置></smartField:SmartField>

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

因为我的注释文件中有这个定义:

<注释项=Common.ValueList"><记录><PropertyValue 属性=CollectionPath";字符串=MarktSet"/><PropertyValue 属性=参数"><收藏><记录类型=Common.ValueListParameterOut"><PropertyValue 属性 =LocalDataProperty";PropertyPath=MarktID"/><PropertyValue 属性 =ValueListProperty";字符串=ID"/></记录><记录类型=Common.ValueListParameterDisplayOnly"><PropertyValue 属性 =ValueListProperty";字符串=名称"/></记录></集合></PropertyValue></记录></注释></注释>

当我打开值帮助对话框时,它是这样的:

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

解决方案

首先,基于

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. a textbox with value help) :

because I have this definition in my annotation file:

<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>

And when I open the value help dialog it is something like this:

The question is how can I show the name of the selected item also in the smart field. I mean instead of showing 1300 (as it can be seen in the first picture) I want to show 1300 (Cimt Handelsgruppe) in the smart field itself.

解决方案

First of all, based on this example I need to change the annotation like this:

<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>

Although it shows the name in brackets when I load an object, it does not show the name after changing the selected ID, unless I use TwoWay binding for the main service model.

这篇关于如何使用 valuehelp 在智能字段中显示名称或描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆