You need to sign in to do that
Don't have an account?
Davser
Calling VF page from an inline page
Hey all,
I have a VF page that I have included in the page layout of my opportunity. In this page I have a command button which I want to use to bring the user to another VF page. However, when I click this button it automatically adds "inline=1" to the url of the second VF page! This has the outcome of displaying this second page without the tabs or sidebar.
Is there a way of stopping this addition of the inline property?
For brevitys sake I'll just post the code pieces that I'm talking about:
By using this the page that is returned is without tabs or side bar. Again this seems to be due to the fact that it automatically appends "&inline=1" to the end of the url.
My workaround is this:
which is fine, but will allow me to delete the IOManagement page, whereas the first code would prevent this.
- switch from apex:commandLink to apex:outputLink, using an action method (requires a server round trip) to simple handle navigation is overkill
- leverage a new feature in Summer '08 $Page in your markup - this works like the Page collection in apex code but can be used directly inside a page formula expression.
this will generate a simple link that will be both the most effecient approach and also correct the specific issue you're trying to solve.
That code actually gives me an interesting error. Because my page is inline I've declared the standard controller with the extensions set to my custom controller like so:
when I use this line there is no problem access the baseOpp variable:
However using your line of code I get the following error in Eclipse:
Save error: Unknown property 'OpportunityStandardController.baseOp'
It seems not to look in my extension controller anymore for the variable. Do I need to put something in front of the baseOpp.Id to indicate it should specifically look in the custom controller class?
Apologies Doug, was just the spelling of baseOpp that was the issue there, variable visibility wasn't an issue.
So I got your code to work, however it displays the edit VF page within the frame that the button was diplayed in (which is just a section within the opportunity page layout).
The premise is to try to get an inline VF page to correctly call a "stand alone" VF page, with tabs and side bar.
My workaround involves using top.location.href because I need the entire page to be replaced with my edit VF page.
Its not really a workaround but a requirement unrelated to visualforce - this is the way links work inside of an iframe which is the container that we have to put inline pages into to insure that they do not produce DOM id collisions or otherwise interact in a negative way with the containing page/layout.
Also, is there anything I can do so the buttons load the button action correctly when in Console mode where sidebars and headers aren't wanted.
If you want to show a button instead of a link in similar inline VF scenario, is the best practice to use outputLink tag as well? something like this:
<apex:outputLink value="{!urlFor($Page.IOManagement, null, [id = baseOp.id])}" target="_top" styleClass="btn">Edit IO</apex:outputLink>
The text in button is undelined, amyway to get rid of it?