Professional Documents
Culture Documents
Contents:
Introduction
Modifying the context structure at runtime
Modifying the UI Element hierarchy at runtime
The use of dynamic actions
CUSTOMID
CLASS
PASSNAME
CARRID
CONNID
FLDATE
PRICE
Coding steps:
Obtain a reference to the metadata of the context node that will act as the new node’s parent.
Call static method create_nodeinfo_from_struct( ) from helper class cl_wd_dynamic_tool to create from a DDIC structure a node.
BOOKID
CUSTOMID
CLASS
PASSNAME
CARRID
CONNID
DATA: dyn_node type ref to if_wd_context_node, Structure SBOOK
FLDATE
dyn_node_info TYPE REF TO if_wd_context_node_info, PRICE
node_name TYPE string value 'FLIGHTS',
. . .
* navigate from <CONTEXT> to <FLIGHTS> via lead selection
dyn_node = wd_Context->get_Child_Node( Name = node_name ).
dyn_node_info = dyn_node->get_node_info( ).
BUTTON_VISIBILITY
Obtain a reference to the metadata of the parent node
TEXT_VISIBILITY
that will contain the attribute
ls_att-name = `TEXT_VISIBILITY`.
ls_att-TYPE_NAME = 'WDUI_VISIBILITY'.
The view is part of the current view assembly and this is the
first time the view is required, or
FLDATE CONNIDLabel
PRICE CONNIDInput
FLDATELabel
FLDATEInput
PRICELabel
PRICEInput
Context Metadata
Context Root
UI Element Hierarchy to Coding steps:
be created at runtime
Connections Check that this is the
CARRID RootUIElementContainer first time the view has
CONNID been rendered
FLDATE Obtain a reference to
PRICE the root UI element
container
method WDDOMODIFYVIEW .
add
Declared action
Coding required
for dynamic
assigned action
* Create button
** create button UI element
wd_button = cl_wd_button=>new_button( text = 'Show Flights'
on_action = 'SELECT_FLIGHTS' ).
** set matrix_head_data for the label
cl_wd_matrix_head_data=>new_matrix_head_data( element = wd_button ).
** add button to container
wd_container->add_child( wd_button ).
Development Principle
Only if the required functionality of your application does not
permit design time declarations, then use a dynamic
modification approach.
DATA:
group_1 TYPE REF TO cl_wd_uielement_container,
new_tab TYPE REF TO cl_wd_table,
dyn_node TYPE REF TO if_wd_context_node,
tabname_node TYPE REF TO if_wd_context_node,
rootnode_info TYPE REF TO if_wd_context_node_info,
stru_tab TYPE REF TO data,
tablename TYPE string.