cancel
Showing results for 
Search instead for 
Did you mean: 

How to Invisible the RadioButton Group By Index

former_member226225
Contributor
0 Kudos

Hi Friends,

                

                 I am using UI element Radiobutton Group by Index Ui element , if the user selects the one radiobutton the remaining two radiobuttons  should  be invisible. Can any Body give the code How to disable the two radiobuttons based on index.

Thanks,

Raghunadh .K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Raghunath,

You need to define an attribute type boolean with default value 'X' .and then you need to bind the VISIBLE property of the Radio Buttons that you need to hide.

If on selecting a radio button  you need to hide other radio buttons.

Then you need to create an action on the radio button( selecting which other 2 radio buttons will be hidden)

In this code you need to Change the value of the attribute(binded to visible property of Other radio buttons ) to ' '.

Thanks and regards,

Gaur Mayank

former_member226225
Contributor
0 Kudos

Hi Gaur,

            Can you give brief explanation for that.

Thanks,

Raghunadh.K

Former Member
0 Kudos
  1. Create a UI element. RADIO BUTTON BY INDEX
  2. Create a node name Value with cardinality 0.n .
  3. Create an attribute Values in the node value.
  4. In WDDOINIT  Method.

write the code.

data ln_value type ref to if_wd_context_node.

data lt_value type table of if_componentcontroller=>element_value.

data ls_value type           if_componentcontroller=>element_value.

ln_value = wd_context->get_child_node( name = 'VALUE' ).

ls_value-values = '1st Radio'.

append ls_value to lt_value.

clear ls_value.

ls_value-values = '2nd Radio'.

append ls_value to lt_value.

clear ls_value.

ls_value-values = '3rd Radio'.

append ls_value to lt_value.

clear ls_value.

ln_value->bind_table( lt_value ).

Now create an action on event'ONSELECT' in radio button property.

there .

In that action write the following code.

data ln_value type ref to if_wd_context_node.

data lt_value type table of if_componentcontroller=>element_value.

data ls_value type           if_componentcontroller=>element_value.

ln_value = wd_context->get_child_node( name = 'VALUE' ).

   le_value->GET_STATIC_ATTRIBUTES(

     IMPORTING

       STATIC_ATTRIBUTES = ls_value ).

*********************************************************************

  IF  le_value = ln_value->GET_ELEMENT( INDEX = 1 )

     ls_value-values = '1st Radio'.

     append ls_value to lt_value.

     clear ls_value.

     ln_value->bind_table( lt_value ).

endif.

For others, Also you can do the same.

Thanks and regards,

Gaur Mayank

Answers (1)

Answers (1)