You need to sign in to do that
Don't have an account?
Uves Ravat
Open a page on Visualforce by a button
Hi,
I want to know how i can open another visualforce page from a visualforce page by the use of button.
The first visualforce page i am using i am adding a contact to database which will have a unique id. when i add the user to the database it should open another visualforce to show the details i have added to the database.
Thank You
use the onclick property of the apex:commandbutton to call a javascript function upon click. In this funciton, put the needed code to open a new window to your URL.
Why, Why JS? :))
If you need pop-up window, I think, you have no choice but to use JS. But you also can return PageReference from the Button Action.
Example:
VF page:
Apex controller:
Am not fussed of poping up a window as long the data appears on the a new page. i am adding data to an object through visualforce page (creating a new contact). after i have input the data and when i click save contact i want all the data i added appear on a visualforce page.