cancel
Showing results for 
Search instead for 
Did you mean: 

How to Show/hide the UI Elements in a WD Application

Former Member
0 Kudos

Hi,

I need to show/hide and control other properties such as required, readonly etc from UI.

Can somebody please tell me how I can do that as I am able to save and retrieve the fields from another UI, now the need is to apply them once the Application starts.

Thanks,

Rachit

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

To show/hide UI elements follow below procedure.

1) define a attribute(VISIBLE in this case) element in the context of type WDUI_VISIBILITY

2) in the UI element properties(Visible) bind the above attribute with the element you want to make visible/Hide.

3) call below method to hide the UI element

wd_context->set_attribute(

EXPORTING

name = 'VISIBLE'

value = cl_wd_uielement=>e_visible-none ).

4) wd_context->set_attribute(

EXPORTING

name = 'VISIBLE'

value = cl_wd_uielement=>e_visible-visible ). for display.

You have to call these method at the right spot.

Thanks,

Sree.

Edited by: t sree on Oct 16, 2008 3:36 AM

phildeane
Participant
0 Kudos

If I understand the question correctly to control the properties of UI element there are two ways.

1) Directly change the value in the doModify:

Eg to hide/show a transparent container:

constants: lc_visible type wdui_visibility value '02',

lc_hidden type wdui_visibility value '01'.

data: lcl_wd_tc type ref to cl_wd_transparent_container.

lcl_wd_tc ?= view->get_element( 'TC_DATA' ).

lcl_wd_tc->set_visible( exporting value = lc_visible ).

2) OR you could create a context node of type wdui_visibility, bind it to the visible property of the UI element. Set the default to visible and you can change that value in the logic.