cancel
Showing results for 
Search instead for 
Did you mean: 

What is the diffrence between "Key to Select" and "Selected Key" while creating Radio Buttons?

vimal
Active Participant
0 Kudos


While creating radio buttons there is a confusion regarding two properties "Key to Select" and "Selected Key".Can anybody explain it with example?

Thanks,

Vimal

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Vimal,

Please find my explanation as below

Key to Select: This is the unique key for each radio button to identify which one is selected

Selected Key: This holds the "KEY" of selected radio button

Example:


   Let us say we have 2 radio buttons : Male & Female

     Create a context attribute SELECTED_KEY of type STRING.

     Create an action ON_SELECT for radio button select event

     Now,

    

     the properties for "MALE" radio button as below

          KEY_TO_SELECT = 'M'

          SELECTED_KEY = "bind to the context attribute SELECTED_KEY

          OnSelect = 'ON_SELECT'.

     The properties for 'Female" radio button as below

          KEY_TO_SELECT = 'F'

          SELECTED_KEY = "bind to the context attribute SELECTED_KEY

          OnSelect = 'ON_SELECT'.

If we select radio button 'Male', we get the key as 'M' and for 'Female' radio button 'F'.

check inside the event handler method ONACTIONON_SELECT, you get the 'KEY' of selected radio button.

So, the context attribute 'SELECTED_KEY'  gets filled with the key of selected radio button

Hope this helps you in distinguishing the 'KEY TO SELECT' & 'SELECTED KEY' .

Regards,

Rama

Answers (2)

Answers (2)

former_member187692
Participant
0 Kudos

Hi Vimal,

         

          Key To Select:- This give the value of the key (field) used for selection of this radio button

  and  Selected Key:-  This specifies the path of the context attributes that has the present field(key).

To get a better understanding have a look at the predefined WDA components like WDR_TEST_UI_ELEMENTS.

Have look into the help.sap.com as well for WDA 'radio buttons by key'.

(I think you can understand better by taking a practical tour of this)

former_member184578
Active Contributor
0 Kudos

Hi,

Check this help: RadioButton Properties - Web Dynpro for ABAP - SAP Library

Selected Key is the property which holds the selected value of radio button and this is a mandatory property.

Key to select is the value of key used to select the radio button( this is optional and bindable).

Regards,

Kiran