1
votes

I'm developing a GWT web App . Righ now I have one default EntryPoint: AppWeb.

The page works perfectly if I run it in the web browser:

http://localhost/AppWeb.

If I open a new tab, and write the same URL, the App works just fine as two instances.

Now, I just want that a simple button in my app open a new windows of the same app and same entry point, just like a new instance. But is not working. I'm using this:

Window.open("AppWeb?guiId=xxx", "_blank", "");

The problem is that the new tab is openen, but is not calling the onModuleLoad of the AppWeb entry point.

1
What happens in that new Window? Does it load the host page? - Andrei Volgin
I have a static object Application that draws all the stuff. It's like isn't creating a new one.. and instead use the same instance. - Mariano L

1 Answers

1
votes

I think you could do it using an anchor http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/Anchor.html

Set the anchor target with

myAnchor.setTarget("_blank");

in your code and in the ui

<g:Anchor ui:field='my anchor' href='' text='click here to duplicate'/>

Note the empty href='' (because it would be appended to your current url).

I tried it and it calls onModuleLoad() when the entry point is called on the new tab.