cancel
Showing results for 
Search instead for 
Did you mean: 

Making view visible/invisible

Former Member
0 Kudos

Hi,

is it possible to make view visible / invisible programatically?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Create a Value attribute of type visibility from Dictionary(com.sap.ide.webdynpro.uielementdefinitions.Visibility)by the name - Visibility and bind it to your View's Visible property.

Now set the visibility of your view that you dont want to be displayed initially as WDVisibiliy.Blank,

in this manner:

wdContext.currentContextElement().setVisibility(WDVisibility.BLANK)

to view display :

wdContext.currentContextElement().setVisibility(WDVisibility.VISIBLE);

Thanks

Tulasi Palnati

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Expert,

View is visible and invisisble by programmatically so have to goto property of View .how to see the proprty of View

1-go to window(option in folder structure) -right clickOpen Navigation Modellerselect perticlar View and right click -go to property--

then see the default property of View then set according to your requirement.

here you will get visible true or false

Thanks

JAti

former_member197348
Active Contributor
0 Kudos

Hi Cemil Bozlagan,

We can do it in different ways depending on the requirement.

1. Embed an empty view (view without any UI elements) and navigate to this empty view when you want make invisible the main view and navigate back when you want to make it visible

2. Using ViewContainerUIElement

In the Layout tab add ViewContainerUIElement to RootUIElementContainer

Create a context attribute of type WDVisibility and bind it to visible property of ViewContainerUIElement.

Go to Web Dynpro Explorer View expand the Windows node-> Select ViewContainerUIElement -> right click Embed View

Now in the implementation, try setting the context attribute to WDVisibility.NONE WDVisibility.VISIBLE

Depending on the requirement and your skills in web dynpro programming you can achieve it in different ways.

Please feel free to revert back in case if you have any queries

Regards,

Siva

Former Member
0 Kudos

Hi Cemil Bozlagan ,

Follow the procedure.

1) Put that view in ViewContainerUIElement.

2)create one context variable of type Visibility(com.sap.ide.webdynpro.uielementdefinitions.Visibility) and map this variable with the visibility property of the that container.

3)and in program write the code.

wdContext.currentContextElement().set<attr name>(WDVisibility.NONE);// for making it invisible

wdContext.currentContextElement().set<attr name>(WDVisibility.VISIBLE);// for making it visible

Regards,

srikanth