Multiwindow CDI with "named" windows

Hi

I use vaadin in a workflow application. I have an inbox, listing tasks and open the UI for the task in a popupwindow (executeJavascript(window.open()), no connection between inbox and UI.

To identify the application, the opened URL contains the name of the task, lets say “customerCheck” and “grantDiscount”. Each task also has a unique taskId. Easy to imagine, there can and will be more then one instance of taskA (“check customer data”, for customers 1,2,3 and 4), and every instance has its own ID.

I need a special case of multiwindow, where I connect the window (or in mvp, the view and the presenter) to the taskId.

THis is how it looks like:

Inbox:

  • customerCheck#1
    -customerCheck#2

click on #1 opens url http:://host:port/context/checkCustomer?taskId=1 in a popup window, or tab.

So I have an application bound to /customerCheck/*, it initializes window, view and presenter and shows the form. So far so good.
But when I go back to the inbox and click #2, I get a 500-error, telling me, the view “already has a parent”.

How can that be? View and presenter are window-scoped …

Anyone tried something like this before? Its a different usecase like the addressbook multi-window, since every window has a context defined by an url-Parameter.

Without CDI this can be easily done, every window is registered with its name (the taskid) and stored in a hashtable, so its simple to access it. But I need CDI for the whole service interaction.

Thanks in advance

Jan