You need to sign in to do that
Don't have an account?
boihue
Displaying of Visualforce Page in a new Window
Hi,
Do any expert know how to display a Visualforce Page in a new separated Window when clicking from a button of the current page?
Best regards!
If the VF page uses a custom controller, then you might have to create an scontrol that simply does the redirect to the VF page url. And then create a custom button to open a new window for the SControl.
I don't see the target attribute available for the <apex:commandButton>.
I had the same situation, using JavaScript is easier but in my experience you have to manage the page state yourself. Apex:CommandLink has the target="_blank" support. But it will appear as link. You can use little CSS to make commandLink appear as button while opening the URL in new window.
<style type="text/css">
a.linkAsBtn,
a.linkAsBtn:hover {
text-decoration: none;
padding: 3px 6px;
}
</style>
<apex:commandLink value="Do Something" action="{!doSomething}" target="_blank" styleClass="btn linkAsBtn"/>
Where doSomething is a action function in controller which returns page reference.