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. Visual Studio Code 使用总结

      记录一下个人在使用 VS Code 中的一些插件和设置.   该配置在编写 vue + iview 项目时使用. 文件路径 用户文件路径:%AppData%/Code/User 用户设置:sett ...

  2. docker、Containerd ctr、crictl 区别

    简述 作为接替 Docker 运行时的 Containerd 在早在 Kubernetes1.7 时就能直接与 Kubelet 集成使用,只是大部分时候我们因熟悉 Docker,在部署集群时采用了默认 ...

  3. Pycharm去除白色波浪线

  4. 批量创建xshell会话

    import re import os import openpyxl from openpyxl import Workbook,workbook from concurrent.futures i ...

  5. About TopoJSON

    An extension of GeoJSON that encodes topology!  TopoJSON https://github.com/topojson/topojson The To ...

  6. 用python从网页下载单词库

    从网站下载单词库 1 每一页有几百个单词 2 每一个单词有独立的URL,URL中包含单词的中文解释 3 使用的库 requests,pyquery,web #coding:utf-8 import r ...

  7. CSP202104-4 校门外的树

    设状态时,首先从简单状态设起: 一维不行再试二维.简单状态应付不了再设复杂的(因为某些状态可以体现在状态转移的过程中,或者说状态转移方程中,不一定体现在原式中) E.g. 计算机软件能力认证考试系统- ...

  8. vue3 门户网站搭建1-路由

    从 0 到 1搭建门户网站,记录一下. 因为需求不大,所以比较简单,门户和后台管理直接一个项目出来,路由配置则想的是: 1.门户,用  /portal 标识 2.后台管理,用 /admin 标识 3. ...

  9. open-local部署和使用

    Open-Local简介 Open-local 是阿里巴巴开源,由多个组件构成的本地磁盘管理系统,目标是解决当前kubernetes本地存储能力缺失问题. Open-Local包含四大类组件: • S ...

  10. (原创)odoo14下qweb模板的前端与后端语法区别

    1.后端(qweb打包) 后端使用t-inherit 指定继承的模板,使用t-inherit-mode 指定继承的模式,使用xpath定位标记,使用position指定扩展位置. 2.前端 前端仍旧使 ...