cancel
Showing results for 
Search instead for 
Did you mean: 

Assign variant value to radio-button in layout

Former Member
0 Kudos

Hi all,

Have radio buttons in a group and they work fine as long as I pick/assign their value (checked/unchecked) on their event.

I have to assign value (check or uncheck) to them on selection of a variant depending upon whether they have been checked in variant or not.

The problem is, suppose I have two radio button A and B.

Now user selects radio-button B and then selects variant. In variant, radio-button A is checked.

At this point A must be 'X' and B should be cleared.

When i debug and check their value, its correct ( A is checked and B is clear) . But in layout both A and B are shown checked.

How sould I make sure that values in layout are also correct?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184111
Active Contributor
0 Kudos

Hi ,

Are you using cookies for variants? Is your application statfull?

Paste the code of layout and condition where you check the values of RBs .

Regards,

Anubhav

Former Member
0 Kudos

Hi,

Yes my application is stateful.

No i am not using cookies.

Code that's working fine.

rbg_sel ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name ='radioButtonGroup'

id = 'rb'

).

IF rbg_sel->selection IS NOT INITIAL.

IF rbg_sel->selection EQ 'rb_var1'.

MOVE 'X' TO rb_var1.

CLEAR : rb_var2 .

ELSEIF rbg_sel->selection EQ 'rb_var2'.

MOVE 'X' TO rb_var2.

CLEAR : rb_var1.

ENDIF.

Code that fetches value for Radio Button from Variant and is not working correctly

itab has values fetched for a given variant.

Loop at itab into wa.

case wa-selname.

WHEN 'rb_var1'.

IF wa-low IS NOT INITIAL.

MOVE wa-low TO rb_var1.

CLEAR rb_var2.

ELSE.

CLEAR rb_var1.

ENDIF.

endcase.

endloop.

The code here will put a check in this radio button but will not remove the check from radio-button rb_var2 ( even though the value in variable gets cleared!! )

(And since value in variable is clearing properly.. output is correct only display is wrong)