cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting the view in the ViewContainerUIElement

Former Member
0 Kudos

i have go two views view1 and view2 in my web dynpro component

In View1 i am having ViewContainer and a Button,

on action of the Button i am inserting View2 in the ViewContainer but the viewcontainer netiher showing the view2 or throwing any exception.

if i keep the same code in wdDoInit method everything works fine but the same code is not working in Button action

what could be the reason ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Both views exist in the same web dynpro component

The fallowing is the code snippet

-


IWDWindowInfo winInfo=wdComponentAPI.getComponentInfo().findInWindows("One");

IWDViewUsageInfo viewUsage= winInfo.getViewUsageByID("OneViewID");

IWDViewContainerAssignmentInfo viewarea=(IWDViewContainerAssignmentInfo)viewUsage.getViewContainerAssignments().iterator().next();

IWDViewUsageInfo newUsage=viewarea.createEmbeddedViewUsage();

IWDViewInfo insertView=wdComponentAPI.getComponentInfo().findInViews("Secondview");

newUsage.setView(insertView);

viewarea.setDefaultViewUsage(newUsage);

-


The above snippets works fine in the wdDoInit method but the same code is not working if i place it in the button action

Former Member
0 Kudos

Praveen,

In general, you may not alter view layout in this way after wdDoInit of view already executed (i.e. view controller has been created) -- WD will not show neither error nor view.

However, you may try to create outbound plug in main view, inbound in internal view, then create dynamically navigation link and fire it -- under certain conditions this technique incarnate "internal" view. (you may read this as "default view usage" behavior does not applied automatically).

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com/

Former Member
0 Kudos

Hi Praveen,

Please explain the problem in Detail.

Both the views are in same component or different ?

Please post the code also.

Regards, Anilkumar