Skip to Content
author's profile photo Former Member
Former Member

Dynamic embedding 1 view in several tabs

Hello,

Im quite new to Web dynpro but im trying to create a tabstrip with several tabs which i create dynamically in the wdDoModifyView. I want the tabs to contain the same custom view i made. This doesnt sounds logical but they want the tabs because of the way it looks but its quite strange to have tabs when all the tabs show the same view.

My question is how can i instantiate my view dynamically? I tried something like this but it doesnt work...

//create a tab
IWDTab queueTab = (IWDTab)view.createElement(IWDTab.class, null);
IWDCaption queueTabHeader = IWDCaption)view.createElement(IWDCaption.class, null);
queueTabHeader.setText(queue.getName());
queueTab.setHeader(queueTabHeader);
queueTabStrip.addTab(queueTab);
//insert the taskviewcontainer element
ViewContainerUIElement taskView = ViewContainerUIElement)view.createElement(TaskView.class, null);
queueTab.setContent(taskView);

Can anyone tell if this is possible?

Thanks in advance,

Hugo Hendriks

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 09:54 AM

    Hugo,

    Refer Valery`s nice solution @ embed-a-view-into-a-viewcontaineruielement-at-runt

    All the best,

    ~ Bala.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 09:56 AM

    Hugo,

    Start simple. Try to embed this view statically, i.e. create ViewElementContainer for every tab and try to place same view several times in Window designer (depending on IDE version you may fail even at this stage). Then run application -- it reports error that same view may not be used multiple times in the same window.

    So first thing you have to do is to extract view into separate component, then create several component usages and place InterfaceView in ViewElementContainer.

    Do you really need to do this dynamically? It's fairly complex...

    Valery Silaev

    EPAM Systems

    http://www.NetWeaverTeam.com

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      mmmm...it looks quite complex like you said. I guess i can do without it and just use plain buttons.

      Thx for the possible solutions though...maybe for future stuff.

      grtz

      Hugo