cancel
Showing results for 
Search instead for 
Did you mean: 

Disable one Radio button among 4 Radiobuttons of a SAME Group

agnihotro_sinha2
Active Contributor
0 Kudos

hi

Is it possible to disable 1 or 2 radiobuttons of the same group ,based on some conditions? I want other radiobuttons to be in active status, but user should not be able to select only 1 radiobutton.

r1

r2

r3

r4

.....

out of these r1 and r3 should be disabled while r2 and r4 should be active at that time.

Is it possible in Webdynpro??

ags.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If you are using RADIOBUTTONGROUPBYINDEX, then you can select the radiobutton you

want under RADIOBUTTONGROUPBYINDEX to disable and uncheck enabled property.

Regards and Best wishes.

agnihotro_sinha2
Active Contributor
0 Kudos

Yes I am using RADIOBUTTONGROUPBYINDEX.

Could you please explain me how do I access each Radio button and disable and enable it based on condition?

I hope my query is clear?

Former Member
0 Kudos

HI,

By setting a attribute for the seperate validation in the node you can decide which button to be

displayed and which one to hide.

The below code i have written in WDDOINIT method of my view


 DATA :
         NODE TYPE REF TO IF_WD_CONTEXT_NODE,
         W_INDEX TYPE I,
         W_TEXT TYPE STRING,
         LIST TYPE STANDARD TABLE OF IF_MAIN=>ELEMENT_RADIOBUTTON,
         W_LIST LIKE LINE OF LIST.
* Appending elements to "itemList"
  W_LIST-EBELN = 'SYDNEY'.
  APPEND W_LIST TO LIST.
  W_LIST-EBELN = 'BRISBAIN'.
  APPEND W_LIST TO LIST.
" Here say i want to hide PERTH if condtion fails so i will use the attribute value 
if <attribute> eq <required value>
  W_LIST-EBELN = 'PERTH'.
  APPEND W_LIST TO LIST.
endif.
   NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = `RADIOBUTTON` ).
  NODE->BIND_TABLE( LIST ).
  NODE->SET_LEAD_SELECTION_INDEX( 1 ). " Always keep the index number that is not hidden otherwise it will go dump
  W_INDEX = NODE->GET_LEAD_SELECTION_INDEX( ).
  CLEAR W_LIST.
  READ TABLE LIST INTO W_LIST INDEX W_INDEX.
  W_TEXT = W_LIST-EBELN.
  WD_CONTEXT->SET_ATTRIBUTE( EXPORTING VALUE = W_TEXT  NAME = 'VIEWTEXT'  ).

Hope it helps.

Regards and Best wishes.