on 08-11-2014 8:19 AM
Dear Experts.
Can any one let me know how to add new input field on click of "+" button and remove the same on click of "-" button.
1)Initially i've created view with one input field and one button icon"+" as shown below
2)And following is the code which has been written on "+"button action
METHOD onactionadd .
DATA lo_nd_user_name TYPE REF TO if_wd_context_node.
DATA lo_el_user_name TYPE REF TO if_wd_context_element.
DATA ls_user_name TYPE wd_this->element_user_name.
* navigate from <CONTEXT> to <USER_NAME> via lead selection
lo_nd_user_name = wd_context->get_child_node( name = wd_this->wdctx_user_name ).
* get element via lead selection
lo_el_user_name = lo_nd_user_name->create_element( ).
* ls_user_name-is_visible = 'X'.
lo_el_user_name->set_attribute( EXPORTING name = `USER_ID` value = 'test' ).
lo_el_user_name->set_attribute( EXPORTING name = `IS_VISIBLE` value = 'X' ).
CALL METHOD lo_nd_user_name->create_element( RECEIVING element = lo_el_user_name ).
lo_nd_user_name->bind_element(
EXPORTING
new_item = lo_el_user_name " List of Elements or Model Data
set_initial_elements = abap_false
" If TRUE, Set Initial Elements Otherwise Add
* index = " Index of Context Element
* RECEIVING
* element = " Web Dynpro: Interface for Context Nodes
).
ENDMETHOD.
3)Following is the output.On click of "+" button it does not add new input field.
Thanks
KH
Hi,
You could use the RowRepeater UI element to achieve this.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
Can you pls explain in detail with any example(if you dont mind).Here i've added lable,input field,button in RowRepeater UI element and noting happens instead it gives me dump on execution.
ERROR: Dynamic type conflict during the assignment of references. (termination: RABAX_STATE)
Thanks
KH
Hi Katrice,
Please check this Wiki. It will help you.
steps to create row repeater ui element - Web Dynpro ABAP - SCN Wiki
BR,
RAM.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.