wood burning stoves 2.0*
The moose likes JSF and the fly likes open new browser window on click of button. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "open new browser window on click of button." Watch "open new browser window on click of button." New topic
Author

open new browser window on click of button.

swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
hi,

on click of h:commandButton I have to open new window and show the result in dat window.
How to open new window on button click.

thanks
Shivaji Byrapaneni
Greenhorn

Joined: Oct 20, 2008
Posts: 22
go for onClick javascript event and call window.open with the required URL.
Eric Härtel
Greenhorn

Joined: Jun 08, 2009
Posts: 8
Try to avoid popups. It's a question of style. Furthermore, there are popupblocker what may block your window. I hate popups. Is there really a reason not to show your result in the window you have?

swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
I have to call the action of commandButton in new window....

I have written the following code

window.open('popup.faces', 'popupWindowName', 'dependent=yes');


<h:commandButton action="#{reportBean.execute}" styleClass="buttonN" value="#{msg.report_exportreport_btnlabel}" onclick="openNewWindow();"/>


but I want the action to performed in the newly open page.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Actions aren't performed "in" pages, they're performed "on" backing beans. Whether the page that's navigated to is in the same window or another one is a different matter. However, in my browser configuration, popup pages are either suppressed or open in invisible tabs, so design accordingly.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open new browser window on click of button.
 
Similar Threads
javascript closing windows
window no url loaction
parent-child windows stuff
opening new window in jsp
Open New Window