Multipane UI element can be used in case of creating a dynamic ui elements in webdynpro abap. Suppose you have to create a set of UI elements based on certain entries dynamically, then you can simply create that set under a multipane and then bind that multipane with that data holding table node.
Then in run time this pane will create similar set as per the table entries.
Here we will try to create a application where on clicking the button the same UI text node will add in the screen.
From the rootuielementcontainer create a multipane UI element.
Then under that you can create your text UI elements like you do for any webdynpro application.
After binding you can see that in view section, the text will come 3 times automatically. Which means it is indicating that multipane is set properly for dynamic entries.
Next in the button on click, write the below code.
DATA lo_nd_node_counter TYPE REF TO if_wd_context_node.
DATA ls_node_counter TYPE wd_this->Element_node_counter.
DATA lt_node_counter TYPE wd_this->Elements_node_counter.
lo_nd_node_counter = wd_context->get_child_node( name = wd_this->wdctx_node_counter ).
ls_node_counter-increase_counter = ls_node_counter-increase_counter + 1.
append ls_node_counter to lt_node_counter.
lo_nd_node_counter->bind_table( new_items = lt_node_counter set_initial_elements = abap_false ).
Activate and execute the application. After execution first screen will be like this.
Now click on the button and you can see that same is getting added one by one.
Now you can create whatever in your mind and play with this UI element. This is a very useful UI element to handle complex dynamic web applications in ABAP.
0 comments:
Post a Comment