cancel
Showing results for 
Search instead for 
Did you mean: 

hide radio button in run time

Former Member
0 Kudos

Hi expert,

kindly help me for hide radio button in run time for web dynpro kindly give me on example .

thank's and regard's

Vikash

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create an Attribute 'CA_VISIBLE' type Boolean.

Bind this attribute to the Visible property of your radio button.

Based on your conditions set that attibute to abap_true/abap_false.


Data: l_elem type ref to if_wd_context_element.

l_elem = wd_context->get_element( ).
l_elem->set_attribute( exporting name = 'CA_VISIBLE'
                     value = abap_false ) " this will hide the radio button.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi.

For Visibility :

-> bind its Visible Property to the context of type WDUI_VISIBILITY.

-> Now make it visible or invisible according to your requirement.

using Code Wizard ( Control + F7) , Set the particular context.

For visible Set as 02.

For invisible Set as 01.

code for your ref ( Generated using Code Wizard- Set the particular context attribute. )

In below code : radiobutton is binded with CA_VIS of type WDUI_VISIBILITY

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_ca_vis TYPE wd_this->element_context-ca_vis.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_context IS INITIAL.

ENDIF.

  • @TODO fill attribute

  • lv_ca_vis = 1.

  • set single attribute

lo_el_context->set_attribute(

name = `CA_VIS`

value = 02 ).

I hope it helps.

Check the sample Wedbynpro Component WDR_TEST_events . This is having the complete UI element functionalities in WDA.

Thanx.

Edited by: Saurav Mago on May 1, 2009 1:53 PM