on 10-16-2012 4:16 AM
WD experts,
Requirement: On every click of a buttion Say ADD set of UI element should appear in the screen with empty values.
But it is copying the values of previous UI elements. This is happnening for every click. the previous values are copied. I have kept views in the Multipane.
My first set (block) in the UI element contains some value. On click of a buttion the second block copies the value of the first blcok Acually the second block of UI elements should be emtpy. I m missing something. I have used the following piece of code :
ls_add points to the structure available in the context.
For action button 'Add'.
CLEAR ls_add.
node_add->get_static_attributes_table( IMPORTING table = lt_add ).
APPEND ls_add TO lt_add.
* ENDDO.
node_add->bind_table( lt_add).
How do i clear values of new UI elements ? Please Let me know if the requirement is not clear.
Thanks,
ABAP Dev
Hi,
Instead of the approach you have used above just create an element and bind it to the node.
1. Use CREATE_ELEMENT method of the node
2. Use BIND_ELEMENT method of the node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply. I have referred some of your thread replies and tried to solve it. But it didnt work out for me.
i tried the following as suggested by you
* get element via lead selection
elem_add = node_add->create_element( ).
node_add->bind_element( elem_add ).
Instead of adding it overwrites the existing one but with the blank values.
I want to the existing UI elements with values. and the other should be empty when a new row is added. Do i have to add anything to the above coding ??
That is the reason i used that get_static_attributes tables.. Please help to resolve this.
Message was edited by: ABAP Dev
Cardinality is 1 : N
Cardinality : 1.
* get element via lead selection
elem_add = node_add->create_element( ).
node_add->bind_element( elem_add ).
-------> for this Overwrites the exsitng UI elements with blank values.
node_add->bind_element( new_item = elem_add
set_initial_elements = abap_false ).
------->For this New items added, but copying the contents of previous values
Message was edited by: ABAP Dev
You can use it with the node.
However i am doubtful that would work either because it does the same thing as with the element.
To use it u just have to write
node_add->set_static_attributes_null( 2 ). If the 2nd element has to be set to Null.
Or
node_add->set_static_attributes_null( EXPORTING index = 2 ).
Hi,
Instead of creating a new element and binding it to the node, try calling method node->bind_structure. You will need to specify set_initial_elements = false to avoid overwriting the existing elements, but all importing parameters for this method are optional so you don't need to pass an explicit initial element.
Cheers,
Amy
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.