on 08-26-2011 3:50 PM
Hello Experts,
I am creating a WDA application and it involves a table where users can key in many line items. I am displaying only 5 rows though. However, when I run the application, although it displays only 5 rows (as I thought) it is allowing only the first row to be editable. How do I make the other 4 rows to be ready for input and also a way for them to create/delete rows?
Thanks,
PK
Edited by: Prakash Kumar on Aug 26, 2011 5:19 PM
Hello Prakash,
The table UI elements simply displays the data in the corresponding context node that is bound as source. In your case I think you have created a context node of cardinality 1..1/1..n and you have bound it to the table. Since the minimum cardinality is 1, by default one context instance is created (by the framework) and you were able to enter value in the first row.
now coming back to your questions
How do I make the other 4 rows to be ready for input
First you need to set the cardinality of the Table's context node to 1..N.
then you need to create 5 context elements and bind the same to the context node
data ls_node type wd_this->element_<node_name>.
data lt_node type wd_this->elements_<node_name>.
data lo_node type ref to if_wd_context_node.
lo_node = wd_context->get_child_node( <node_name> ).
do 5 times.
append ls_node to lt_node.
enddo.
lo_node->bind_table( lt_node ).
a way for them to create/delete rows?
create two buttons in the table for CREATE and DELETE and in the corresponding event handler method create/delete the context element instance.
hope this helps.
BR, Saravanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.