1 Reply Latest reply on Jun 4, 2009 5:21 AM by Nick Belaevski

    HtmlMenuItem and setTarget

    Nicola Ben Novice

      Hi,
      I am generating menu via code.
      I need to have a new window open and click on a menu.
      I did like that but it doesn't work.

      ...iterating on a list of childMenu...
      HtmlMenuItem menuItem = new HtmlMenuItem();
      // set SubmitMode and onClick
       menuItem.setSubmitMode("none");
       String onClick = "document.location.href='";
       String reportLink = [...build my link....]
      
       if (childMenu.isReport()) {
       onClick += reportLink + "'";
       menuItem.setTarget("_new");
       }
       menuItem.setOnclick(onClick);


      In the HTML generated code I don't see any target="_new" inside.
      Any suggestions, please?

      Thank you,
      Nicola