When using A4J and Richfaces in a web application, I have a requirement to trigger the opening of a new browser window upon the user's click on the <a4j:commandButton>
.
To achieve this, I believe I will have to utilize the window.open(URL, ...)
method. However, I am uncertain about where exactly I should place this code.
The definition of my <a4j:commandButton>
is as follows:
<a4j:commandButton id="elementDetailsButton"
onclick="if (!confirm('Are you sure? Unsaved data will be lost')) { return false; }"
action="#{myBean.elementDetailsAction}"
value="Element Details">
<a4j:actionparam name="elementDetailsString"
value="getElementDetails()"
assignTo="#{myBean.elementDetails}" noEscape="true">
</a4j:actionparam>
</a4j:commandButton>