on 04-14-2011 7:33 PM
Here is my situation.
I have a table I am reading into my web dynpro. There are five fields, each may or may not contain an 'X'.
I have a checkboxgroup in my web dynpro. What I need to do is read field one, and if it is 'X', set the first checkbox in the group to true. Then do the same with the other four fields. I am using a checkbox group because I am reading the labels for the fields from an existing table.
I am have not used a checkboxgroup so this is new to me. Can anyone provide some code examples I can use to get my head around this?
Thanks in advance.
Hi,
See the help here. [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/ad884118aa1709e10000000a155106/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/ad884118aa1709e10000000a155106/content.htm]
See the example component as described on the help page.
Basically you need a context-node of cardinality 0..n. The number of element in the node represents number of checkboxes in the group.
bind the enabled property based on the value X from the table column.
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 response.
I've looked at the help and the examples in WDR_TEST_EVENTS and it doesn't seem to address my question. It doesn't show me how to take the values from a database table and check off the corresponding boxes in in a checkboxgroup automatically. It was helpful in allowing me to check off the boxes and passing the value to my database table.
data lo_node type if_wd_context_node.
lo_node = wd_context->get_child_node( name = wd_this->wdctx_YOUR_NODE ).
loop at lt_my_table into ls_my_table.
if ls_my_table-check_field = 'X'.
lo_node->set_selected( index = sy-tabix ).
endif.
endloop.
or something like this. You can also reference the selected property at the if_wd_context_element level which does not require an index.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.