Sorry, my bad. It turned out, that a browser extension had removed the target attributes from the html, just after it was attached to the DOM.
I will create a proper patch file about it. Regards Zsombor On Thu, Jul 12, 2012 at 3:41 PM, <[email protected]> wrote: > Hmm, interesting, because on an other gwt project, > > Anchor a = new Anchor("click me"); > a.setTarget("_blank"); > my_panel.add(a); > > worked flawlessly. > > Thanks > > On Thu Jul 12 15:11:51 GMT+200 2012, Manuel Carrasco Moñino < > [email protected]>. wrote: > > Gwt Anchor widget is thought to maintain the user in the same page so as > the app is not replaced accidentally. So the correct code is: > Anchor a = new Anchor("click me"); > a.addClickHandler(new ClickHandler() { > public void onClick(ClickEvent event) { > Window.open("/show_attachments/", "_blank", ""); > } > }); > your_panel.add(a); > > If you want to add html code to the view you can use the HTML widget, but > you have to be aware about what you do. > > HTML h = new HTML("<a href='/your_url' target='_blank'>click me</a>"); > your_panel.add(h); > > > - Manolo > > On Thu, Jul 12, 2012 at 9:52 AM, <[email protected]> wrote: > > > Hi, > > > > I've recently started using hupa, and it's awesome, with a couple of > > glitches. For example, it is impossible to subscribe to this mail list > > using hupa, because of the email address validation regexp ;) But it was > > easy to fix. I've tried to implement a 'View attachment' functionality > for > > attachments (the servlet related parts was simple - skip the > > 'content-disposition' header), I've stucked on creating a 'View' link > with > > target="_blank". It seems that, I can create Anchor object with > > setTarget("_blank"), and I can add it to the container - and in that > case I > > can still see the generated html is correct, but in the browser, that > > attribute is removed. Do you know any functionality which could adjust > the > > html ? It seems a bit overkill to have click handler on it, and call > > Window.open(...), instead of using the builtin html functionality. > > Other question, I see, there are git mirror repositories of apache > > softwares at http://git.apache.org , but there is no repo for hupa - > can > > you create one ? With a github mirror would be awesome ;) > > > > Thanks > > Zsombor > > > >
