on 02-28-2014 8:04 AM
Hi All,
I want to display and toggle between two radio buttons, I have tried ways mentioned in few posts, but still could nt get it.
I hv attached the screen shot. In the wddoinit method of my view i have added code (attached the code also).
but still both my RB are displayed as selected. Also Please throw some light on what occassion we use group by index and group by key.
Regards,
Hi Naren,
Please refer the below links
To know more about these elements,
RadioButtonGroupByKey - Web Dynpro for ABAP - SAP Library
https://help.sap.com/saphelp_nw70ehp1/helpdata/en/d7/f08841e3af1609e10000000a155106/content.htm
Example: For RadioButtonByKey
Radio Button Group By Key | Webdynpro ABAP
Example: For RadioButtonByIndex
Radio Button Group By Index | Webdynpro ABAP
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naren,
Please do not bind the property KEY_TO_SELECT to same attribute, it should be having different keys
Only bind the "Selected key" to same attribute
Please refer the below snap shots
Now, upon select event, the selected key will be filled,
ie. if you select radio button 1, the key 1 will be set to the attribute.
Hope this resolves your issue.
Regards,
Rama
Hi Ram,
I am unable to achieve the functionality. i have binded as per ur suggestion above.
when i first time open the url, my first RB is selected and 2nd RB is not selected.
As in intialization.i hv coded.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_rb1 TYPE wd_this->element_context-rb1.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
* @TODO fill attribute
lv_rb1 = 1.
* set single attribute
lo_el_context->set_attribute(
name = `RB1`
value = lv_rb1 ).
* set single attribute
lo_el_context->set_attribute(
name = `RB2`
value = space ).
now in select event of first and second button i hv added like this.
for 1st button event
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_rb1 TYPE wd_this->element_context-rb1.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
IF lo_el_context IS INITIAL.
ENDIF.
* @TODO fill attribute
lv_rb1 = 1.
* set single attribute
lo_el_context->set_attribute(
name = `RB1`
value = lv_rb1 ).
lo_el_context->set_attribute(
name = `RB2`
value = space ).
for 2nd button event
* @TODO fill attribute
lv_rb1 = 2.
* set single attribute
lo_el_context->set_attribute(
name = `RB1`
value = space ).
lo_el_context->set_attribute(
name = `RB2`
value = lv_rb1 ).
my 2nd button is unable to select, i mean initialization is being triggered again i guess, so when i commented the initialization code, no default RB is slected.please suggest
regards,
regards,
those radios need to be bound to the same attribute in the selectedKey property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.