How do I open a new window?
Added by Frank B almost 2 years ago
Hi,
I have context sensitive help for my application. It's a WRessource, that simply delivers the html files/images from a zip-like archive.
I'd like to open this help in a new window for the relevant topic when the user clicks on a Help-Menu. I have the menu in place, my slot get's called, I know wich WTabWidget "Page" is selected, so I know the URL to open. But I can't find a function to open the url.
And for later on (I'm not there yet): I need to open a new window and display some (actually quite a massive amount) of data in it. This is no ressource, it's part of the application. In short I need to display a Widget in a new window. How can I do that?
Thanks
Frank
Replies (3)
RE: How do I open a new window? - Added by Koen Deforche almost 2 years ago
Hey Frank,
This sounds like WAnchor::setTarget(NewWindow) ? There is no other (reliable) way of opening a new window because popup blockers are well in place in most browsers. A user needs to do this explicitly by clicking on an anchor.
The second scenario: you will need to give the new window a new session, and then it is a matter of creating an anchor which reference a particular internal path for that second window ?
Regards,
koen
RE: How do I open a new window? - Added by Frank B almost 2 years ago
Hi Koen,
Thanks.
Hmmm, can I set an Anchor for a Popupmenu-Item? I've seen, I can set one for a pushbutton, but I found nothing for a popupmenu-item.
Popup-Blockers are not a problem, because it's not public available, only for the staff of our custumors. It runs on their local intranet.
I'm quite new to all this web stuff, but I saw there is a java script method window.open(). Can I execute java script from an event handler?
Bye
Frank
RE: How do I open a new window? - Added by Koen Deforche over 1 year ago
Hey Frank,
Certainly you can call javascript.
The ones that may interest you:- WApplication::doJavaScript(): from a server-side event handler
- EventSignal<>::connect(cons std::string& js): directly client-side
Regards,
koen
(1-3/3)