on 08-11-2013 7:03 PM
Hi experts,
can anyone tell me how I can define which button within a radiobuttongroup is selected by default in webdynpro?
I have a group of 5 buttons, the first one always is selected by default. But I would like to have the 3rd button as the default button
How can I achieve this?
Thanks, Richard
Hi Richard,
in order to change the default selected radio button, you need to set the lead selection to required node
write the below code after BIND_TABLE method where you are populating the required radio button text.
lo_<node>->bind_table( new_items = lt_<table> set_initial_elements = abap_true ).
lo_<node>->move_to( index = 3 ).
Points plz if helpful.
Regards
Subhash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
By default the first radio button will be selected. In WDDOINIT method after populating the radio button texts and binding, Use set_lead_selection_index method to set the default selection.
Try the below code:
DATA lo_nd_radio TYPE REF TO if_wd_context_node.
DATA lt_radio TYPE wd_this->elements_radio.
DATA ls_radio TYPE wd_this->element_radio.
* navigate from <CONTEXT> to <RADIO> via lead selection
lo_nd_radio = wd_context->get_child_node( name = wd_this->wdctx_radio ).
* Fill Radio Button Texts
ls_radio-value = 'Value1'.
APPEND ls_radio TO lt_radio.
ls_radio-value = 'Value2'.
APPEND ls_radio TO lt_radio.
ls_radio-value = 'Value3'.
APPEND ls_radio TO lt_radio.
lo_nd_radio->bind_table( new_items = lt_radio set_initial_elements = abap_true ).
lo_nd_radio->set_lead_selection_index( 2 ). " Set default selected radio button
" Here I set 2nd radio button by default, you can pass the index which you want the default selecton
Hope this helps u.,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.