Button can't work in IE
In my application, I have the following combination of <h:outputLink> and <p:commandButton>:
<h:outputLink target="_blank" value="theURL"> <p:commandButton value="Click" type="button" /> </h:outputLink>
The above button works normally in Chrome and Firefox. However, when I use IE, nothing happens when I click the button.
I'd be very grateful if you could give me any advice.
The resulting HTML markup makes syntactically no sense. You end up with an
Whose action should be invoked? The one of the link or the button?
I'd suggest to just use <p:button> with a window.open().
<p:button value="Click" onclick="window.open('theURL');return false;" />
If using the link was for pure SEO purposes, then I'd suggest to replace the <p:commandButton> by its own generated markup as a <span> instead of as <button>. E.g.
<h:outputLink target="_blank" value="theURL"> <span class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button"> <span class="ui-button-text">Click</span> </span> </h:outputLink>