cancel
Showing results for 
Search instead for 
Did you mean: 

radio buttons..

Former Member
0 Kudos

does anyone know how to get the ticked button in the radio buttons? i tried using this code but it doesn't work:

data_rb ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'radioButton'

id = 'RB1' ).

Accepted Solutions (1)

Accepted Solutions (1)

guillaume-hrc
Active Contributor
0 Kudos

Hi,

<u>You should always embed your radioButton in a radioButton group.</u>

You should always check the sample applications provided by SAP for this.

<b>SBSPEXT_HTMLB/RadioButtonGroup.bsp</b> show you how to do it

Besides, it is also available in the component help (F1 on the element)

DATA: radioButtonGroup TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
radioButtonGroup ?= CL_HTMLB_MANAGER=>GET_DATA(
                          request      = runtime->server->request
                          name         = 'radioButtonGroup'
                          id           = 'myRadioButtonGroup1' ).

IF radioButtonGroup IS NOT INITIAL.
  selection = radioButtonGroup->selection.
ENDIF.

Hope it helps!

Best regards,

Guillaume

eddy_declercq
Active Contributor
0 Kudos

Hi,

As with 'classic' HTML, only the checked buttons will be in the HTTP request and the values will be sent back to the server and thus retrievable with request->get_form_field. Unchecked buttons will not be retrievable.

Eddy

Answers (0)