| Author |
Open New Window using h:commandButton
|
Varshini Priya
Ranch Hand
Joined: Feb 17, 2008
Posts: 83
|
|
I need some help on how to open a page in a new Tab on click of the command button. I know I can acheive this using the javascript. But I would like to acheive this using JSF code and not Javascript. Im using JSF2.0. I have already been able to establish this using commandLink by adding target="_blank". But I would like to acheive the same using commandButton. Also is there anyway if we can specify the javascript code in the backend to open the page in a new tab?? please assist.
Thanks in Advance
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
The JSF commandButton control does not support the target attribute, unlike the commandLink. What most people do is fake it by decorating a commandLink to look like a button.
None of the popular J2EE servers have JavaScript interpreters built into them, so any JavaScript code would have to run on the client.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Varshini Priya
Ranch Hand
Joined: Feb 17, 2008
Posts: 83
|
|
Thanks for the response Tim. I was able to acheive this via the below code . Thought of sharing it, since it might be useful for someone else.
|
 |
 |
|
|
subject: Open New Window using h:commandButton
|
|
|