cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the Visibility of Groups in a View.

Former Member
0 Kudos

Hi,

Here is a Scenario

There Two WD Views in View 1 there are three groups,in second group i have a button Next, if i click this button it will navigate to View 2, in View two there are five groups,

I want after clicking Next Button only first three views should be visible in View2 leaving 4 and 5th view.

how do i can do this..

Regards,

RK

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can use the visibility property of the Group Element to make it invisible.

In the doModifyView

get the object of the 4th and the 5th element.

Based on a condition

IWDGroup grp4 = (IWDGroup) view.getElement("Group4");

grp4.setVisible(WDVisibility.NONE);

or

grp4.setVisible(WDVisibility.BLANK);

This should make the group not visible

Hope this solves your problem.

Regards

Prakash

Former Member
0 Kudos

Hi RK,

Just to add to Prakash's answer,

before the if condition, first set the Visibility to VISIBLE. This will ensure, if the condition changes in the view, in the next reload of the view you can see the Group.

grp4.setVisible(WDVisibility.VISIBLE);

Also there is a difference between WDVisibility.NONE & WDVisibility.BLANK

WDVisibility.BLANK will display an empty area depending on the size of the Group.

WDVisibility.NONE will not display anything on the view.

Regards,

Shubham

Message was edited by: Shubham Tripathi

Former Member
0 Kudos

If you want to manipulate the visibility in this way, don't use wdDoModifyView() but use data binding.

Armin

Former Member
0 Kudos

Just to add to Armins answer.

Create a data element in the context of type Visibility, which is available under


Dictionary Simple Type
 |_ Local Dictionary
     |_ com.sap.ide.webdynpro.uielementdefinition.Visibility

then you bind the visibility property of the group to your newly created context element, and updates the visibility of the element in the action method of your button.

This is the prefered way, since it provides a cleaner design.

See http://help.sap.com/saphelp_nw04/helpdata/en/15/0d4f21c17c8044af4868130e9fea07/frameset.htm for more information.

Regards

Mattias