You need to sign in to do that
Don't have an account?
JustinMcc
Button on VF Page used in standard layout reloads iFrame not whole page
Hello
so I have a visualforce page that displays a table of information that I use on a standard object's page layout. There is a command button in this Visualforce page, my problem is that when I click the command button instead of the whole page being redirected it only redirects the iFramew when used as part of a Page layout.
Is there any way to get this button to redirect the whole page?
Thanks,
Justin
I don't think there is using a commandbutton, as there's no suitable attributes for this and it has to be controlled client side.
If you can swap your comandbutton for a commandlink, you can specify the target="_top" attribute which should do the trick. You can also style your commandlink to look like a button (try style="btn")
All Answers
I don't think there is using a commandbutton, as there's no suitable attributes for this and it has to be controlled client side.
If you can swap your comandbutton for a commandlink, you can specify the target="_top" attribute which should do the trick. You can also style your commandlink to look like a button (try style="btn")
<input class="btn" type="button" value="click me" onClick="javascript:window.top.location.replace("{!returnUrl}") />
Yes, it works even cross-domain. You can even POST cross-domain to top page such as:
<form action="https://c.cs3.visual.force.com/apex/myVFpage" method="POST" target="_top">
notice how i used the FQN of the VF page, if wont work if you POST to http://cs3.salesforce.com/apex/myVFpage since this will redirect and drop the POST data...GET will work though