on 06-25-2008 1:44 PM
Hi all,
We have a requirement to make multiple entries in a Table in webdynpro ABAP.
We have created a table and inserted inputfield as cellEditor
but at runtime it is being displayed in readonly mode we cannot enter anything in that inputfield.
inputfield is binded with a context and table is not in readonly mode.
Please help in this regards
thanks & regards.....
Gaurav Makin
Hi Gaurav,
Make sure the context node bound to the table has cardinality 0..N.
When the app starts you probably need to read the table contents from the database or some other source and populate the contect node.
The table will allow the user to edit values only for the rows that have a corresponding element in the context node.
If the initial content is empty, i.e. no elements in the context node then the user will not be able to edit.
You will need to either initialize the context node with a bunch of elements if the number of entries is fixed and known beforehand, or provide a way for the user to create a new row.
You can do this by adding a toolbar to the table with a create button with a CREATE action and the following method:
method onactioncreate.
data:
lo_element type ref to if_wd_context_element,
lo_node type ref to if_wd_context_node.
lo_node = wd_context->get_child_node( name = 'your node name here' ).
lo_element = lo_node->create_element( ).
lo_node->bind_element( new_item = lo_element set_initial_elements = abap_false ).
endmethod.
Regards... Lucio Menzel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks Lucio,
the following code works fine, problem is solved
method onactioncreate.
data:
lo_element type ref to if_wd_context_element,
lo_node type ref to if_wd_context_node.
lo_node = wd_context->get_child_node( name = 'your node name here' ).
lo_element = lo_node->create_element( ).
lo_node->bind_element( new_item = lo_element set_initial_elements = abap_false ).
endmethod.
thanks & regards...
Gaurav Makin
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.