On Tuesday, September 11, 2012 6:16:43 PM UTC+2, Thomas Lefort wrote:
>
> Hi,
>
> Thanks to both of you.
>
> Regarding teh anchor, I did try with the following code, but it still
> doesn't work.
>
> Anchor anchor = new Anchor();
> anchor.setHref("#EISearchResultPlace:" + result);
> anchor.setTarget("_blank");
> anchor.setVisible(false);
> RootPanel.get().add(anchor);
> anchor.fireEvent(new GwtEvent<ClickHandler>() {
>
> @Override
> public com.google.gwt.event.shared.GwtEvent.Type<ClickHandler>
> getAssociatedType() {
> return ClickEvent.getType();
> }
>
> @Override
> protected void dispatch(ClickHandler handler) {
> handler.onClick(null);
> }
> });
>
fireEvent() is a GWT-ism, it does not dispatch an event to the element;
there's absolutely no event going on in the browser with fireEvent.
First, you should use an AnchorElement which is lighter-weight than an
Anchor widget, then simply use JSNI to call the click() method (or, without
JSNI: cast() to a ButtonElement)
I tried the URL trick from Thomas (1st suggestion) and it does work fine
> wrt the URL, so that's one porblem solved, thanks! but the window is still
> some stripped down version of my initial Chrome window and it is a window,
> not a tab...
>
You cannot force opening in a new tab or window, it all depends on the
browser's configuration. In other words, it's at the user's discretion, and
should stay that way (you'll find numerous discussions at the WHATWG or W3C
HTML WG when people proposed adding a new _blankTab or similarly-named
token, or new attributes on <a> to ask for a new tab rather than window, or
control this through CSS, etc.)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/mjR6F7jYTIYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.