cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Transperant container visible , invisble by code

Former Member
0 Kudos

Dear experts ,

I want make transaperant container visible or invisible based some boolean value .

I have gone thr' class CL_WD_UIELEMENT and CL_WD_TRANSPARENT_CONTAINER. I have found method SET_VISIBLE .

Let suppose name of my transperant container TC_COSTCENTER .Please let me know what code I have to write . Where should I write ?

I am writing it code in WD_INIT as this process is based on value that I get on boolean value which tell decide visibility of Transperant container.

Waiting for reply . Urgetly .

Points will be given surely .

Cheers

Parry

Accepted Solutions (1)

Accepted Solutions (1)

SergioFerrari
Active Contributor
0 Kudos

The easiest way is to Bind the property Visible to a boolean attribute of your context and fill this attribute from ABAP as needed.

Otherwise you are going to use Dynamic Programming that is for WDA "experts"...

Sergio

shwetars
Advisor
Advisor
0 Kudos

Hi Parry,

The dynamic programming way is follows:

you need to first get a reference to the root element 'ROOTUIELEMENTCONTAINER' from the view reference available within the wddomodifyview method. the variable returned is of type cl_w_uielement_container. you can use the method get_root_element( ) of the interface if_wd_view for this purpose.

next get a reference to the transparent container by using the method get_child of the class cl_wd_uielement_container( using the variable returned from the prevoius call) and cast it to a variable of the class cl_wd_transparent_container. to this method you need to pass the id of your transparent container.

Once you have the reference you can use the method set_visible( ) to make the container visible or invisible at runtime.

However you need to be careful about the placement of this code within the wddomodifyview method because it would get executed every time. Thus the best way is to store the reference to view in a component controller the first time and later on use this attribute anywhere within your component.

Regards,

Shweta

Former Member
0 Kudos

hi Shweta,,

We are facing some problem in visibility of transparent container.

We want to invisible the transparent container on a click of button, but we dont know how to store the reference to view in a component controller the first time and later on use this attribute anywhere within our component.

We are only able to place the code in modifyview.

Please help us in this regard...

thanks

Gaurav

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

create an attribute X type wdy_boolean.

bind this attribute to property visible of transparent container.

then using set_attribute(name = 'X' value = ' ' ) to make tranparent container invisible

and pass the value = 'X' to make transparent container visible.

Former Member
0 Kudos

Solved

Former Member
0 Kudos

Friends ,

My problem was resovled .It was nt by dynamic programming .It by seeting value if WDUI_VISIBLITY value as 01 , 02 .