Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Hyperlink in MenuItem

    Hello,

    I would like to have a menu with allows the user to open a menu item in a new browser window -- how can this be done? I'd have to somehow put a Hyperlink into a MenuItem, or is there another way?

    thanks in advance
    Thomas.

    #2
    You could try something like this:
    Code:
    final Menu menu = new Menu ();
    final MenuItem menuItem = new MenuItem (title);
    menuItem.addClickHandler (new ClickHandler () {
      public void onClick (final MenuItemClickEvent event) {
        final String features = null;/*
          "status=1," + 
          "toolbar=1," +
          "location=0," +
          "menubar=1," + 
          "directories=1," +
          "resizable=1," + 
          "scrollbars=1," + 
          "dependent=true";*/
        com.google.gwt.user.client.Window.open (
          "http://www.google.com",
          "newWindowName",
          features);
      });
    menu.addItem (menuItem);

    Comment

    Working...
    X