You need to sign in to do that
Don't have an account?
trf199
Putting a Visualforce page in the sidebar?
I'm trying to put a Visualforce page in the sidebar. I know you can do this by adding a homepage html component containing an iframe that points to your Visualforce page, but this seems to cause a "Redirect Loop" error in Firefox.
"Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."
It works ok in IE though.
Does anyone know any other or best practice ways to include Visualforce content in the sidebar?
Thanks,
Tom
All Answers
Hey
I have used a template to create a sidebar, and then each of my pages uses this template. Have a look at the SiteTemplate.page in your Org.
Your steps would be something like this:
1. Create a tempalte ie. a Page with <apex:page sidebar="false"....>
2. In this page create an outputPanel(div) on the left that is your sidebar and a blank content area that your pages will use
3. Create <apex:insert> tags where you'd like to insert content into the template
4. Create your new page set <apex:page showHeader="false"
5. Include the template in your page <apex:composition name="templatePageName">...
6. To insert content into the tmeplate use <apex:define name="insertName">page content here</apex:define>
This will make your app consistent. There's alot to learn initially but this simplifies things in the long run. I recommend looking at SiteTemplate.page as well as all of the components it uses. Also use the component reference to read up on all the visualforce I've mention here i.e. apex:define, apex:composition, apex:insert
Cheers,
Wes
Unfortunately yes. Any standard pages wouldn't be able to use this template unless they were replaced with visualforce pages.
It's a pity the side bar isn't more easily configurable, but I'm sure it's in their road map.
Wes
Thanks, the html component is as follows:
<iframe style="border: medium none ;" src="/apex/nvmagent?core.apexpages.devmode.url=1" width="100%" height="350"></iframe>
The page is as follows:
<apex:page sidebar="false" controller="MyController" tabStyle="Account" showHeader="false">
<!-- <apex:form >-->
<!-- <apex:pageBlock title="Congratulations {!$User.FirstName}">-->
<!-- You belong to the Account Name: <apex:inputField value="{!account.name}"/>-->
<!-- <apex:commandButton action="{!save}" value="save"/>-->
<!-- </apex:pageBlock>-->
<!-- </apex:form>-->
<apex:pageBlock title="AMB stuff">
login: {!loginResult}<br />
<apex:outputPanel id="statusPanel">
status: {!Status}
<apex:actionStatus startText=" ." id="myStatus">
</apex:actionStatus>
<apex:form >
<apex:actionPoller action="{!checkStatus}" reRender="statusPanel,flags" interval="5" status="myStatus" oncomplete="checkFlags()"/>
<apex:commandButton action="{!checkStatus}" value="update" reRender="statusPanel,flags" status="myStatus" oncomplete="checkFlags()" />
<!--<apex:actionFunction name="checkStatusFunction" action="{!checkStatus}" rerender="statusPanel" status="myStatus" timeout="10000" immediate="true"/>-->
</apex:form>
</apex:outputPanel>
<apex:outputPanel id="flags" layout="block">
<input type="hidden" id="displayDialPanel" value="{!DisplayDialField}"/>
</apex:outputPanel>
<apex:form >
<p id="dialPanel" style="display:none;">
<input type="text" id="dialField" value="" size="20" style="width:100px"/>
<apex:commandButton action="{!dialNumber}" value="dial" />
</p>
</apex:form>
</apex:pageBlock>
<button onclick="checkFlags()">check flags!</button>
<script type="text/javascript">
function checkFlags()
{
document.getElementById("dialPanel").style.display = document.getElementById("displayDialPanel").value;
}
</script>
</apex:page>
Firefox version is 3.0.11. I think I get the redirect loop error no matter how simple the visual force code, so maybe the iframe is at fault?
I believe I've narrowed the problem to not displaying when in standard pages, only when in visualforce pages, something to do with whether salesforce is redirecting to the c.na6.visual.force.com or na6.salesforce.com domain? Can you post your html component please for comparison? Thanks