on 04-01-2008 8:44 AM
Hi All
I added check box group to my UI and totally dsiplaying 8 check boxes.
In 8 check boxes I selected more than one check box.
how we can capture how many check boxes selected in Check box group?
Thanks
Rama..
Hi Rama,
Unfortunately there is no direct method to get the selected checkboxes in a group.
Instead what we can do is.
The check box group is bound to a context node of cardinality to hold more than 1 records.
So when you want to get the selected records, do the following.
DATA lo_nd_checkbox TYPE REF TO if_wd_context_node.
DATA lo_el_checkbox TYPE REF TO if_wd_context_element.
DATA lt_el_checkbox TYPE wdr_context_element_set.
DATA ls_checkbox TYPE wd_this->element_checkbox.
DATA lt_checkbox TYPE TABLE OF wd_this->element_checkbox.
* navigate from <CONTEXT> to <CHECKBOX> via lead selection
lo_nd_checkbox = wd_context->get_child_node( name = wd_this->wdctx_checkbox ).
* get element via lead selection
lo_el_checkbox = lo_nd_checkbox->get_element( ).
CALL METHOD lo_nd_checkbox->get_selected_elements
RECEIVING
set = lt_el_checkbox.
Describe the table lt_el_checkbox to get the number of check boxes selected.
If you want the values of the checkboxes selected, then do the following.
LOOP AT lt_el_checkbox INTO lo_el_checkbox .
* get single attribute
lo_el_checkbox->get_attribute(
EXPORTING
name = `TEXTS`
IMPORTING
value = ls_checkbox-texts ).
APPEND ls_checkbox TO lt_checkbox.
CLEAR ls_checkbox.
ENDLOOP.
So now the table lt_checkbox holds the selected checkboxes.
Hope this helps.
Regards,
Sravan Varagani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi rama krish...
you would have bound your checkboxes to an attribute. read those attributes and check for the x field.
---regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.