cancel
Showing results for 
Search instead for 
Did you mean: 

Radiobuttongroupbykey set readonly

Former Member
0 Kudos

Hi!

How can i set only one or two radiobuttons in a radiobuttongroupbykey to readonly?

My problem is that i have a radiobuttongroupbykey with 3 buttons. The buttons are binded to

an attribute with 3 values. 0, 0.5 and 1. In some cases only one of these three buttons may be selectable.

Should i use three seperate buttons for this or is it possible to use the radiobuttongroupbykey?

Hope someone could help me!

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Yes you can disable a few radio buttons from a radiobutton group.

Create an attribute 'editable' type boolean in your node.

Bind this to the editable property of your radiobutton group.

Now based on your condition pass abap_true or abap_false.

  DATA: itemlist TYPE if_v_main=>elements_cn_radiobtn,
        w_list LIKE LINE OF itemlist.
  w_list-key = 'Black'.
  w_list-editable = abap_true. " editabke
  APPEND w_list TO itemlist.  

  w_list-key = 'White'.
  w_list-editable = abap_false. "disabled
  APPEND w_list TO itemlist.

  w_list-key = 'Orange'.
  w_list-editable = abap_true. " editable
  APPEND w_list TO itemlist. 

  w_list-key = 'Pink'.
  w_list-editable = abap_true. "editable
  APPEND w_list TO itemlist.

  DATA: items_node TYPE REF TO if_wd_context_node.

  items_node = wd_context->get_child_node( name = `CN_RADIOBTN` ).
  items_node->bind_table( itemlist ).

Regards,

Radhika.

Former Member
0 Kudos

Hi!

It works nice!

Thank you very much!

Regards!

Answers (1)

Answers (1)

Former Member
0 Kudos

Refer the standard component : Wdr_test_Events