1.17 UI Element:Context Menu使用

本实例测试创建Context Menu.

1.创建Component,View: V_CONTEXT_MENU;

2.创建Context节点;

创建Node:NODE_TV,Cardinality:1..1;

创建Attribute:TV1,类型String;

创建Node:NODE_ATTR,Cardinality:1..1;

创建Attribute:MENU_CHK, 类型WDY_BOOLEAN;

创建Attribute:MENU_RADIOBTN,类型WDR_DEMO_FRUIT;

创建Attribute:MENU_CHK1,类型WDY_BOOLEAN;

3.创建Layout页签;

创建UI Element:MenuBar,ID:MENUBAR;

创建UI Element:Menu,ID:MENU;

创建UI Element:Menu,ID:MENU_SUB1;

创建UI Element:MenuActionItem,ID: MENU_CHG,绑定Action: MENU_CHG;

创建UI Element:MenuActionItem,ID: MENU_ADD,绑定Action:MENU_ADD;

创建UI Element:MenuSeparator,ID:MENU_SEP1;

创建UI Element:Menu,ID:MENU_SUB2;

创建UI Element:MenuRadioButton,ID:MENU_BTN,绑定Action: MENU_SEL,selectedKey绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_RADIOBTN;

创建UI Element:MenuRadioButton,ID:MENU_BTN1,绑定Action:MENU_SEL,selectedKey绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_RADIOBTN;

创建UI Element:MenuSeparator,ID:MENU_SEP2;

创建UI Element:Menu,ID:MENU_SUB3;

创建UI Element:MenuCheckBox,ID:MENU_CHK,绑定Action:MENU_TOG,checked绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_CHK;

创建UI Element:MenuCheckBox,ID:MENU_CHK1,绑定Action:MENU_TOG,checked绑定Context的Attributes: V_CONTEXT_MENU.NODE_ATTR.MENU_CHK1;

创建UI Element:TextView,text绑定Context的Attributes: V_CONTEXT_MENU.NODE_TV.TV1;

4.创建Method页签,实现Action方法;

实现Action: MENU_ADD,Menu选择Add;

代码实例:

  DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element. lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = 'Menu:add'
).

实现Action:MENU_CHG,Menu选择change;

  DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element. lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = 'Menu:change'
).

实现Action:MENU_SEL,Menu选择Radio Button;

代码实例:

  DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element.
DATA:lo_event TYPE REF TO cl_wd_custom_event.
DATA:lv_string TYPE string.
lo_event = wdevent.
lv_string = lo_event->get_string( name = 'KEY' ).
lv_string = 'Menu:radio button,' && lv_string.
lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = lv_string
).

实现Action:MENU_TOG,CheckBox选择事件;

代码实例:

  DATA:lo_node TYPE REF TO if_wd_context_node.
DATA:lo_element TYPE REF TO if_wd_context_element.
DATA:lo_event TYPE REF TO cl_wd_custom_event.
DATA:lv_id TYPE string.
lo_event = wdevent.
lv_id = lo_event->get_string( name = 'ID' ).
lv_id = 'Menu:checkbox' && lv_id.
lo_node = wd_context->get_child_node( wd_this->wdctx_node_tv ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
EXPORTING
name = 'TV1'
value = lv_id
).

WDA学习(24):Context Menu使用的更多相关文章

  1. Android -- Options Menu,Context Menu,Popup Menu

    Options Menu                                                                           创建选项菜单的步骤: 1. ...

  2. Android Contextual Menus之一:floating context menu

    Android Contextual Menus之一:floating context menu 上下文菜单 上下文相关的菜单(contextual menu)用来提供影响UI中特定item或者con ...

  3. Tree Context Menu

    Right click on a node to display context menu.   My Documents Photos Program Files Intel Java Micros ...

  4. android学习笔记37——Menu资源

    Menu菜单资源 android应用推荐使用XML来定义菜单,其可提供更好的解耦方式. 菜单资源通常位于res/menu文件夹下,其菜单根元素为<menu.../>,menu元素下可包含子 ...

  5. create Context Menu in Windows Forms application using C# z

    In this article let us see how to create Context Menu in Windows Forms application using C# Introduc ...

  6. Win7/Win8右键菜单管理工具(Easy Context Menu) v1.5 绿色版

    软件名称: Win7/Win8右键菜单管理工具(Easy Context Menu)软件语言: 简体中文授权方式: 免费软件运行环境: Win8 / Win7 / Vista / WinXP软件大小: ...

  7. Description Resource Path Location Type Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix. spark-MT line 1 Maven Co

    1.相信大家新建的maven项目,然后添加好依赖(即修改了pom.xml文件以后就会出现如下所示的错误): Description Resource Path Location Type Projec ...

  8. sublime text 3-right click context menu

    dd a system wide windows explorer button " Edit with Sublime" similar to how Notepad++ doe ...

  9. 手机浏览器中屏蔽img的系统右键菜单context menu

    我们知道通过oncontextmenu事件可以屏蔽浏览器右键菜单 $('img').on("contextmenu",function(E){E.preventDefault(); ...

  10. Vue 2.0 右键菜单组件 Vue Context Menu

    Vue 2.0 右键菜单组件 Vue Context Menu https://juejin.im/entry/5976d14751882507db6e839c

随机推荐

  1. centos8 安装docker启动失败

    借鉴https://www.zqcnc.cn/post/71.html systemctl status docker● docker.service - Docker Application Con ...

  2. CentOS下下查看硬盘型号、大小等信息(含Raid)

    一.普通模式(该机硬盘没有做磁盘阵列) 1.fdisk -l 查看你的硬盘编号,如sda,sdb 等 2.smartctl --all /dev/sda [html] view plain copy ...

  3. vue过滤出字符串中的汉字,match加正则

    vue过滤出字符串中的汉字,match加正则 str="23申迪MTN001(102380026)";str.match(/[\u4e00-\u9fa5]/g).join(&quo ...

  4. ADE-XL bsub提交超时

    查找命令行log, Fatal server error: could not open default font 'fixed' 解决方案: yum install 'xorg-x11-font*'

  5. float高度塌陷和BFC

    开启BFC方式: 1.设置浮动float(副作用比较大,不推荐) 2.将元素设置为行内块元素 display:inline-block:(不推荐) 3.将元素的overlfow设置为非visible的 ...

  6. (0403)位运算符+interface

    1)interface 2)位运算符

  7. Educational Codeforces Round 143 (Rated for Div

    Educational Codeforces Round 143 (Rated for Div. 2) Problem - B Ideal Point 给定n个线段区间\([l,r]\),我们定义\( ...

  8. 解决Delphi报Range check error错误

    没有深入研究,大体是Debug下编译的运行就报错,Release下编译的正常. 后来发现Debug模式下会打开越界检查. Project--> Option -->Delphi Compl ...

  9. noi 2.1基本算法之枚举

    7647:余数相同问题 1.描述 已知三个正整数 a,b,c. 现有一个大于1的整数x,将其作为除数分别除a,b,c,得到的余数相同. 请问满足上述条件的x的最小值是多少? 数据保证x有解. 2.输入 ...

  10. chatgpt 的训练数据时间内容估计

    I noticed that the data you quoted is dated September 2021, but it's already 2023. I apologize for t ...