Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

open new browser window on click of button.

 
swapnel surade
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
go for onClick javascript event and call window.open with the required URL.
 
Eric Härtel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18155
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic