how to populate values in dropdownbykey in webdynpro
来源:互联网 发布:mysql可以没有主键吗 编辑:程序博客网 时间:2024/06/05 07:49
There are 2 types of dropdown ui elemts:
1. For DropDownByIndex UI element we need to bind the text property to an attribute within a context node, which contains several elements (cardinality = 0..n). The number of elements defines the possible entries in the list. In the WDDOINIT method we can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
For example if u have defined a node 'TEXT' with cardinality '0..n' with attribute TEXT. Bind the text property of DropDownbyIndex UI element to attribute Text of context node Text.
In the WDDOINIT method you can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
The below code sample may help.
- method WDDOINIT .
- data:
- node_text type ref to if_wd_context_node,
- stru_text type if_componentcontroller=>element_text,
- tab_text type if_componentcontroller=>elements_text .
- node_text = wd_context->get_child_node( name = if_componentcontroller=>wdctx_text ).
- * Set/fill your values
- stru_text-text = 'Value1'.
- append stru_text to tab_text.
- stru_text-text = 'Value2'.
- append stru_text to tab_text.
- * set values to the node
- call method node_ddi_also_text->bind_table
- exporting
- new_items = tab_text.
- endmethod.
2. For DropDownByKey UI element bind the SelectedKey property to an attribute within a context node. Then you must provide the fixed values (table with key value combination) in a different way and store them in the node info. We can use the elements get_attribute method to get the attribute value which user has selected.
For this we need to use the interface IF_WD_CONTEXT_NODE which has a method GET_NODE_INFO, which returns meta information on the respective node. This information is of type IF_WD_CONTEXT_NODE_INFO.
Kindly refer the following code:
- method WDDOINIT .
- data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
- NODE type ref to IF_WD_CONTEXT_NODE.
- NODE = WD_CONTEXT->GET_CHILD_NODE( 'NODE1' ).
- NODE_INFO = NODE->GET_NODE_INFO( ).
- * To be able to store the fixed values for the attribute in the node info, two
- *additional variables are necessary:
- data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
- L_VALUE type WDR_CONTEXT_ATTR_VALUE.
- *WDR_CONTEXT_ATTR_VALUE is a data type defined in the DDIC. It contains *two components KEY and VALUE, both of type STRING.
- *WDR_CONTEXT_ATTR_VALUE_LIST is a table type stored in the DDIC, whose *rows are of type WDR_CONTEXT_ATTR_VALUE.
- *The two variables created in the source text example are used to accept the value *pairs that will later be passed to the node info.
- L_VALUE-VALUE = 'V1'.
- L_VALUE-TEXT = 'yesterday'.
- INSERT L_VALUE into table LT_VALUESET.
- L_VALUE-VALUE = 'V2'.
- L_VALUE-TEXT = 'today'.
- INSERT L_VALUE into table LT_VALUESET.
- L_VALUE-VALUE = 'V3'.
- L_VALUE-TEXT = 'tomorrow'.
- INSERT L_VALUE into table LT_VALUESET.
- NODE_INFO->SET_ATTRIBUTE_VALUE_SET (
- NAME = 'ATTRIBUTE1'
- VALUE_SET = LT_VALUESET ).
- endmethod.
- how to populate values in dropdownbykey in webdynpro
- Webdynpro ABAP 系列: How to display smartform in WDA
- How to store CGRect values in NSMutableArray?
- How to retrieve checkboxes values in jQuery
- How to sum values in an array with different hash
- How to set default values for IBInspectable in Objective-C?
- webdynpro dropdownbykey的使用
- How to display column values in a single cell in Web Intelligence using Oracle database ?
- Linq to SQL how to do “where [column] in (list of values)”
- How to get access to edit/get pixel values of Mat in OpenCV
- Re: How to use values of properties file in selenium code - msg#02103
- How to sort a Map<Key, Value> on the values in Java?
- How to make gdb print out all values in hexadecimal mode?
- How to Scroll in iPhone in Voiceover
- How to erase in vector
- How to screenshot in Linux
- How to Daemonize in Linux
- How to Daemonize in Linux
- 无法打开cufft.lib文件以及无法解析cufft的相关的外部符号的解决方法
- CodeForce Football
- 阿里云Python-SDK管理安全组和RDS实例IP白名单
- SSM框架的搭建之Maven依赖
- SSM框架中-使用KindEditor+Nginx服务器+FTP服务,实现多文件上传
- how to populate values in dropdownbykey in webdynpro
- jdbc连接数据库
- Debugging hibernation and suspend
- 明明白白你的Linux服务器——硬件篇
- iOS 实时获取当前应用消耗的CPU和内存
- mark mybatis 返回boolean
- 数据校检Hibernate Validator 5.4.2.Final--前言
- iOS 静态库制作(Xcode9.0)
- 学习记录——Serlvet接口doGet()、doPost()