WDA学习(27):RoadMap使用
1.20 UI Element:RoadMap使用
本实例测试创建RoadMap;
运行结果:
点击2,Input显示输入航班Id
点击3,根据input输入,查询航班信息
1.创建Component,View: V_ROADMAP;
2.创建Context节点;
创建Node:NODE_INPUT,用户输入航班ID;
创建Attribute:CARRID,保存CARRID;
创建Node:NODE_OUTPUT,显示输出航班信息;
Table:SPFLI字段信息;
创建Node:NODE_CONFIG,控制页面输入,输出显示;
创建Attribute:SHOW_INP,类型:WDUI_VISIBILITY,控制输入显示;
创建Attribute:SHOW_TAB,类型:WDUI_VISIBILITY,控制Table输出显示;
3.创建Layout UI Element
创建RoadMap:RM;
onLoadSteps: 绑定Action,LOAD_ROADMAP;
onSelect:绑定Action,SEL_ROADMAP;
创建RoadMapStep:START,
name:1
创建RoadMapStep:INPUT,
name:2
创建RoadMapStep:OUTPOUT,
name:3
创建RoadMapStep:END
name:4
创建Transparent Container,包含InputField和Label
visible: 绑定Attribute,NODE_CONFIG.SHOW_INP;
创建InputField:INP
value: 绑定Attribute,NODE_INPUT.CARRID;
创建Table:TAB,绑定spfli查询数据;
dataSource:绑定Node, NODE_OUTPUT,
visible:绑定Attribute,NODE_CONFIG.SHOW_TAB;
4.实现Method页签方法
Method: SEARCH_DATA,根据输入carrid,查询spfli信息;
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node. DATA:lo_element TYPE REF TO if_wd_context_element. DATA:lv_input TYPE spfli-carrid. DATA:lt_spfli TYPE wd_this->elements_node_output. DATA:ls_spfli TYPE wd_this->element_node_output. "获取节点 lo_node = wd_context->get_child_node( wd_this->wdctx_node_input ). lo_element = lo_node->get_element( ). lo_element->get_attribute( EXPORTING name = 'CARRID' IMPORTING value = lv_input ). SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_spfli FROM spfli WHERE carrid = lv_input. lo_node = wd_context->get_child_node( wd_this->wdctx_node_output ). lo_node->bind_table( new_items = lt_spfli ).
Method:ONACTIONSEL_ROADMAP,Action:Sel_roadMap对应方法
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node. DATA:lo_element TYPE REF TO if_wd_context_element. DATA:lv_step TYPE string. DATA:lv_visible TYPE wdui_visibility VALUE '02'. "获取节点 lo_node = wd_context->get_child_node( wd_this->wdctx_node_config ). lo_element = lo_node->get_element( ). lv_step = wdevent->get_string( name = 'STEP' ). CASE lv_step. WHEN 'START'. wd_comp_controller->show_msg( msg = 'start' msg_type = 'S' ). lv_visible = '01'. lo_element->set_attribute( EXPORTING name = 'SHOW_INP' value = lv_visible ). lo_element->set_attribute( EXPORTING name = 'SHOW_TAB' value = lv_visible ). WHEN 'INPUT'. lo_element->set_attribute( EXPORTING name = 'SHOW_INP' value = lv_visible ). WHEN 'OUTPUT'. lo_element->set_attribute( EXPORTING name = 'SHOW_TAB' value = lv_visible ). wd_this->search_data( ). WHEN 'END'. wd_comp_controller->show_msg( msg = 'end' msg_type = 'S' ). lv_visible = '01'. lo_element->set_attribute( EXPORTING name = 'SHOW_INP' value = lv_visible ). lo_element->set_attribute( EXPORTING name = 'SHOW_TAB' value = lv_visible ). WHEN OTHERS. ENDCASE.
WDDOINIT方法,初始化设置隐藏Input,Output;
代码实例:
DATA:lo_node TYPE REF TO if_wd_context_node. DATA:lo_element TYPE REF TO if_wd_context_element. DATA:lv_visible TYPE wdui_visibility VALUE '01'. "获取节点 lo_node = wd_context->get_child_node( wd_this->wdctx_node_config ). lo_element = lo_node->get_element( ). lo_element->set_attribute( EXPORTING name = 'SHOW_INP' value = lv_visible ). lo_element->set_attribute( EXPORTING name = 'SHOW_TAB' value = lv_visible ).
本文来自博客园,作者:渔歌晚唱,转载请注明原文链接:https://www.cnblogs.com/tangToms/p/16937957.html