cancel
Showing results for 
Search instead for 
Did you mean: 

how to hide a ui element at run time

Former Member
0 Kudos

hai all,

can any one plese tell me how to hide an UI Element at run time.

thanks & regards

SREEVATHSAVA.G

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

thanks

shaik_sajid
Active Contributor
0 Kudos

Hi,

This link will give u a clear idea

[;

regards

sajid

petesc82
Explorer
0 Kudos

Hello SREEVATHSAVA,

to reach your aim you could use the standard hook method WDDOMODIFYVIEW of your view.

For example, to hide button "BUTTON_1" (ID), the following code should help you :


method WDDOMODIFYVIEW .

  data: LR_BUTTON            type ref to CL_WD_BUTTON.

  LR_BUTTON ?= view->GET_ELEMENT( 'BUTTON_1' ).

  LR_BUTTON->SET_VISIBLE( VALUE = '01' ).
 
endmethod.

Hope that helps,

Peter

Former Member
0 Kudos

Hi,

Make use of WDUI_VISIBILITY.

take a context node attribute of type WDUI_VISIBILITY, bound the same to VISIBLE property of the UI element.

Use the below code.

call method elem_visible->set_attribute

exporting

name = 'VISIBLE'

value = '01'.

Former Member
0 Kudos

Hi,

Is your uielement a static? If so, follow these steps;

1. Create an attribute say 'VISIBLE' type boolean

2. Bind this attribute to the visible property of the uielement

3. Now when you want to hide it , set the 'VISIBLE' attribute to abap_false

l_elem->set_attribute( exporting name  = 'VISIBLE'
                                 value = abap_false ).

Regards,

Radhika.

Former Member
0 Kudos

Hi,

For hiding any UI element, you have to create a context attribute of type WD_BOOLEAN(char 1), bind this context attribute to the 'VISIBLE' properly of UI element.

Now for hiding, you have to set the context attribute value to SPACE and if you want to get it back displayed, set the same to 'X'.

Regards,

Manne.

Former Member
0 Kudos

hi SREEVATHSAVA ,

you can set the properties for UI element by calling set_attribute_property

* call method set attribute property and pass value as 'X' to ENABLE 
 DATA lo_el_radio_node2_1 TYPE ref to if_wd_context_element. 
  call method lo_el_radio_node2_1->set_attribute_property
    exporting
      attribute_name = 'FIRST_NAME_2'
      property       = 4
      value          = 'X'.

Thanks ,

chinnaiya P