You need to sign in to do that
Don't have an account?
Button on Visualforce page
Hi everybody,
I want button on Visualforce page, which navigate to other visualforce page. Please, can some body has idea, how can i create it?
I want button on Visualforce page, which navigate to other visualforce page. Please, can some body has idea, how can i create it?
1. To open your visualforce page in new tab 2. Open your visualforce page in same tab
Replace the test3 with your custom visualforce page name
So, what are you after? I'll try to type it up for you:
You want to put a button on a custom visualforce page, that when clicked, loads a DIFFERENT page inside an iFrame on the SAME page?
What you are probably going to end up wanting to do is stick an "Id=" on the iFrame and then using the first link from S.Karanraj's answer above, but in the onclick - instead of window.open - you want to use the javascript to redirect the location of the iFrame.
obviously you will want more attributes (such as height and width) on the iframe. but at a glance I think that is legit.
The only bit of visualforce is the button.. there is an <apex:iframe /> tag, which you might want to look into:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_iframe.htm
but anything you can achieve visualforce you can also achieve with straight up html/css/javascript
(and so, for the record, you need commandbuttons to be inside an apex:form tag - so wrap your apex:pageBlock in a pair of those)
This is my code:
But when i clicked on Project button, i don`t load the visualforce page. Why?
this is really simple debugging though man, come on - try some things yourself ;)
Atually, i want to display the some page inside the visualforce page. I have found the this code on internet, but it is not working. Can you please help me to find out. When the Google button is clicked the google page should display and when the yahoo button is clicked the yahoo page should display.
Page:
Apex Class:
maybe there is a good reason for doing that (such as you found with the frame not rendering the page right).
I'd probably determine which route you wish to go down and pursue it. I think both will work. The controller will require test coverage too, remember.
Please, can you help me to fix this. May be you can try in your org, what that the problem is.
Press F12 to launch your browser debugging tool and when you click the button, scroll through the DOM definition to see what you are putting into the src.
I would bet it's something like:
https://eu5.salesforce.com/www.google.com
or some weird mashup where you arn't setting a straight up URL from the start, rather than putting a relative one on the end of where your Salesforce currently resides.
click your button and then find the iFrame again (the elements panel will blink/change when you do) - and find the src again - it will have the new URL you have assigned to your iFrame.
Are you using the Apex controller approach now, or the original Javascript one we started work on?
This is the screen shoot.