Skip to Content
Former Member
Aug 09, 2006 at 08:46 AM

Dynamicly embed a View



there are already some topics around here covering this task a little, but my solution doesn't work.

Additionaly I don't want some dynamic component stuff or anything, I just want my View named EmbeddedView to be inserted into another view.

Should be that complex (but it is).

Could someone please gibe me a hint why my solution doesn't work:

1. my wdDoModifyView:

/* I create an ViewContainerUIElement and add a ViewContainer by using a name which is stored in the context (containername) */

if (firstTime) {

IWDViewContainerUIElement viewcontainerui = (IWDViewContainerUIElement) view.createElement(IWDViewContainerUIElement.class, null);


IWDTransparentContainer root = (IWDTransparentContainer) view.getRootElement();



2. my wdDoInit() Method

/* I simply try to create a new viewcontainer containing my in this component existing view. At the end I add the name of the container to my context */

IWDViewInfo viewinfo = wdComponentAPI.getComponentInfo().findInViews("EmbeddedView");

IWDViewContainerInfo viewcontainer = viewinfo.createViewContainer();


The result is an exception

" View container UI element test in view HideTest2View of component HideTest2 represents view container -271470246_0 which does not contain a view"

Best regards