You need to sign in to do that
Don't have an account?
hoagieryder
Tabbed Visualforce Page
I want to create a visualforce page that has two tabs that when clicked display two separate visualforce pages. When the page is open the first visualforce page is display, when the tab is clicked the second page is displayed. This would work similarly to the "tabbed accounts in 30 seconds tutorial" but with visualforce pages, not standard objects. Is this possible?
Yes, there would be several ways, but the easiest way, if you have existing visualforce pages, would be iframes. Here is a quick example:
You will probably have to add id parameters to the urls in order to get the tabs to display the correct records and probably write a custom controller to get those ids, but this should get you started.
You can use the below code.
Please let me know if there is any issue.
Thanks,
Devendra Natani | Salesforce Certified Developer
Blog
In my case Page1 & Page2 are the same, except a parameter changes the output. There seems to be no support for page params via URL or via field.
In my case, I want "On Click" of the Tab header, it to fetch the same URl with a difference of a param supplied to the container.
How can I achieve it? (... without iFrames ...)
like <url>?myparam=xyz
You can still do that with the Iframes I mentioned and you may be able to do that with the Apex:include tag but I have not tested it.
I found a solution to my problem (Not sure if its the best, but it works fine).'
1. Ensure switchType attribute of the <apex:TabPanel> is "client"
2. ontabenter="window.location='./currentPage?myParam=xyz'"
Note: If switchType is "server" then the window.location javascript becomes de-fiunct. Anyway the JavaScript will make it a Server call so switchType should be "client" for all we care.