You need to sign in to do that
Don't have an account?
Renato Garofalo 13
Go to a specific URL after one click inside a VF page
I'm using a script and windows.open function to go to a specific URL when a user click a button on the VFpage. Something is going wrong because after the click the same page is reloaded.
SCRIPT:
Inside the retURL variable, there is the URL where I want to go, something like:https://eu6.salesforce.com/0015800000DuQWsAAN'
button:
How can I solve this problem?
SCRIPT:
<script type="text/javascript"> function goback() { window.open(retURL); } </script>
Inside the retURL variable, there is the URL where I want to go, something like:https://eu6.salesforce.com/0015800000DuQWsAAN'
button:
<apex:commandButton action="{!deleteContract}" value="Elimina Contratto e prodotti selezionati" immediate="true" onclick= "goback()" /> </apex:pageBlockButtons>
How can I solve this problem?
When you execute the script after that the action is executed and when action is completed it reload the whole page because you not set the specific section for reRender.
So you can done through two ways:
1. Set return false in onclick and this will execute only your script but your action can not executed: 2. Set the reRender the particular section or set oncomplete as "return false".
Thanks.