Creating the Value Set for a DropDownByKey Element
来源:互联网 发布:linux mysql 是否启动 编辑:程序博客网 时间:2024/05/17 07:03
Overview
When using a DropDownByKey or DropDownByIndex element, the set of possible values is available automatically only for context attributes having a data type with fixed values defined in the underlying domain. Here we show how to manually create the set of possible values when fixed values are not available in the data type’s domain.
Scenario
You want to create a DropDownByKey UI element for data element VSBED (Shipping Conditions) which has its possible values defined in check table TVSB.
Procedure
1.0 Create a Context Node
In the COMPONENTCONTROLLER, create a context node with cardinality 1..1 and selection 0..1. Then create the attribute VSBED, defined as follows.
2.0 Populate the Attribute Value Set
In method WDDOINIT of the COMPONENTCONTROLLER, enter the following code to define the set of possible values for context attribute VSBED.
method WDDOINIT. DATA lo_nd_node TYPE REF TO if_wd_context_node. DATA lo_node_info TYPE REF TO if_wd_context_node_info. DATA lt_value_set TYPE wdr_context_attr_value_list.* -- Bind value set for the DropDownByKey element lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ). lo_node_info = lo_nd_node->get_node_info( ). SELECT tvsb~vsbed AS value tvsbt~vtext AS text FROM tvsb JOIN tvsbt ON tvsbt~vsbed = tvsb~vsbed INTO TABLE lt_value_set WHERE tvsbt~spras = sy-langu ORDER BY text. lo_node_info->set_attribute_value_set( EXPORTING name = 'VSBED' value_set = lt_value_set ).endmethod.
3.0 Create the DropDownByKey UI Element
Copy the context node from the COMPONENTCONTROLLER to the desired view. Now create a DropyDownByKey UI element and bind its selectedKey property to context attribute NODE.VSBED.
Result
The value set for context attribute VSBED is populated upon initialization of the COMPONENTCONTROLLER and is displayed in the view’s DropDownByKey UI element.
- Creating the Value Set for a DropDownByKey Element
- Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename,...
- How to set default value for a field
- Failed to set the 'value' property on 'HTMLInputElement': This input element解决办法
- Creating a workspace for catkin
- The steps for creating a DNS for scan IP of RAC 11Gr2
- The Ethical Hack: A Framework for Business Value Penetration Testing
- '{DependencyProperty.UnsetValue}' is not a valid value for the '.........Background'
- Configuration problem: <property> element for property 'articleService' must specify a ref or value
- could not set nil as the value for the key verifyStatus
- setNilValueForKey:could not set nil as the value for the key distance.解决方案
- iOS could not set nil as the value for the key
- Creating a Set of Training Images
- A Class for Creating a Trace Log
- Set CommandTimeout for a TableAdapter in the DataSet
- Creating a Compelling UI for Windows Mobile and the Microsoft .NET Compact Framework
- Oracle OEM 配置报错: No value was set for the parameter DBCONTROL_HTTP_PORT 解决方法
- oracle EM创建报错“No value was set for the parameter PORT”
- Android Profiler
- 双系统下ubuntu无法识别Windows的硬盘(Ubuntu无法读写某些硬盘)
- C++ vector中指针元素内存处理
- 简便抽奖
- Linux下Redis安装使用,主从模式,哨兵模式与PHP扩展(PHP7适用)
- Creating the Value Set for a DropDownByKey Element
- session的基本用法
- test
- log4j的配置和使用
- Hibernate的学习之路十一(Session的一级缓存和证明存在)
- 实用类介绍1
- Android 构架师之路 UML
- 判断是否为手机号码
- vue之模板语法