cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the "default" Property of a Views

Former Member
0 Kudos

Hello,

if a view is assigned to a window, you can choose in the properties the default value true or false.

Normally I´m using the plugs to call the different views

in a window.

Unfortunately the plug does not work if the same view is assigned twice to a window, by using different ViewContainer. Only one View should be active at the same time. It works fine if I change it manually in the properties.

But I did not find a way to get access to this setting by using IWDView, IWDViewInfo ...

Is it possible to change the default value of the view?

Thanks and Regards, Mario

Accepted Solutions (0)

Answers (1)

Answers (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Mario,

the dynamical manipulation of view compositions is currently not documented. The solution for your relatively simple scenario looks like this:

<b>1.) Declaratively assign an id to the embedded view</b>

For an easy programmatic access to the embedded view 'HugoView' (or better to the corresponding view usage info) you first have to assign an <b>ID</b> to it declaratively.

In the Web Dynpro Explorer select the view you embedded into a window e.g. view "HugoView" in view area "VictorViewArea" in view set "CharlyViewSet" in window "FoxtrottWindow". Select the properties view and enter the id-property-value "HugoViewId". This ID is not defined by default - but the Web Dynpro View Manager creates an own id itself.

<b>2.) Controller Coding </b>

With the defined view ID it is quite simple to access the corresponding <i>IWDViewUsageInfo</i>-object in the controller coding:

IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("FoxtrottWindow");    
IWDViewUsageInfo viewUsageInfo = windowInfo.getViewUsageByID("HugoViewId");    
IWDViewContainerAssignmentInfo parent = viewUsageInfo.getEmbeddingViewContainerAssignment();    
parent.setDefaultViewUsage(viewUsageInfo); 

That's all. Your view 'HugoView' will be displayed in the initial view assembly as default view.

Regards, Bertram

Former Member
0 Kudos

Hi Bertram,

just wondering: Do you have a pilots license? Anyway, your NATO naming conventions are not consistent, "HugoViewId" should be "HotelViewId" instead )

Best regards, Stefan

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Stefan,

no I have no pilots license but I watched the 'Flying Doctors' TV series in former times. I think they did not use 'Hotel' very often - so my mind applyed the 'Hugo'-fallback.

Sorry me, all real Web Dynpro 'pilots'.

Greetings, Bertram

Former Member
0 Kudos

Hi Bertram,

Is this only possible at WDDOINIT method? I could use to do this at WDDOMODIFYVIEW if possible because I am receiving a URL parameter from the Window's HANDLEDEFAULT method and setting the context. Since WDDOINIT runs before this HANDLEDEFAULT, I don't have the URL parameter at this time yet.

Is there a way to get the URL parameter first and then call this?

Thanks,

Ogeday