Skip to Content

Component usage and creating popup windows dynamically

Hi folks,

I have created a webdynpro component A which has 2 windows.

Window 1 has somewhere code in a view to call window 2 as a popup window.

It works all fine when just testing the component.

Now I have another component B which is basically the main menu of the application - in that menu I have 2 links which should show window 1 and window 2 of the same component A. Works fine.

But my popup window doesn't work anymore ... Well it doesn't work when I allready showed the referenced window via the second link.

Looking at the "createWindow" method it says that " ... a creation of a new instance of a windowInfo is only possible, if it doesn't exist any other window instance with the same windowInfo (including interface views, which are embedded in other component instances). ".

So I changed my referencing model from "createondemand" into "manual" and

used the following code with the idea that I created 2 different instances of the same component and that I would be fine ( added the delete part later on as only creating didn't work ):

if (wdThis.wdMyComponentUsage().hasActiveComponent())





But doesn't work either ... I think I am not completely clear on the idea here ...

Basically I want 2 independant instances of the same component and I don't want them interfering on window usage ... so I can happily open my popup window ...

Is that possible ? According to the help I am not able to open the window as it is allready opened somewhere else - great - but I deleted the component first so I would think that would remove the window usage as well ???



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 08, 2006 at 11:23 AM

    After closing the window u have to destroy the window's instance.

    Store reference of window in a context value attribute or static variable.

    <WindowrefVariable> =



    Destroy the window reference after closing the window.


    Add comment
    10|10000 characters needed characters exceeded

  • Dec 11, 2006 at 02:42 PM

    Thanks for the reply but I am allready destroying the window like you mentioned.

    The problem is that it is not even getting opened when the window has been shown first via the other main menu link.

    And although I destroy the component usage - the window instance is apparently still somehow 'active' ( although its not even visible anymore ).

    Any other experts got any insights on this ????



    Add comment
    10|10000 characters needed characters exceeded

  • Dec 13, 2006 at 09:13 AM

    Hi Folks,

    In the meanwhile I solved this issue in the most badly way ... I created a new window and attached a copy of my view to that window et voila ... it works ...

    The whole idea was to avoid this kind of duplicate coding and UI but apparently the webdynpro framework is forcing me in doing so ...

    I would be more then happy if somebody would point me out that I missed something conceptually ...

    To recap, basically I open a DC from 2 different locations in a web dynpro application and open the same window twice - once as a normal and once as a popup - this only works properly as long as the window hasn't been opened allready as a normal one ... Although I deliberately create the component instantiation manually and have put in delete code ( which is getting executed as I debugged it ), the window instance remains 'active' (while not even visible anymore ) and as such prevents it from getting openend in the popup ... I would have thought that the whole idea of using DC is reusability but apparently that doesn't work out for window instances ...


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Bertram,

      Thanks for passing this further on ... I will also create a CSS message.

      It's actually not the popup window I need to destroy programmatically - that is working fine allready ( using the destroy method ) ...

      I need to destroy the non-popup window instance - the one which I didn't create myself programmatically - it is created by firing the plug which starts the default plug of the embedded component window instance.

      I first opened the window normally, then when the other menu link is clicked I destroy the component and at that moment I would hoped the window instance was destroyed ( but it isn't apparently )so I need to kill it myself at that point ...

      Looking at the availble methods I can't find anything suitable ...

      Further on the popup gets created, shown and destroyed fine ...

      Like allready stated, the popup only gets created properly when the contained window hasn't been shown first via the other linkage ...