Print this page

“Under Construction” error message when calling a page with an apex:iframe

Knowledge Article Number 000170756
Description If we set a url from a controller as follows. “PDLPersonalChequesProcessStep1” is my Apex page defined. In developer mode, they set the url as = 'apex/PDLPersonalChequesProcessStep1' 

public void SetFirstStep() { 
currentStepWizardURL = '/PDLPersonalChequesProcessStep1'; 
currentStep = 1; 
currentStepWizardURL = currentStepWizardURL + '?Id=' + tranID; 


<apex:outputPanel id="panelPDLPersonalChequeSteps"> <apex:iframe id="framePDLPersonalChequeSteps" scrolling="true" height="400" src="{!currentStepWizardURL}"/> </apex:outputPanel> 

“currentStepWizardURL” attribute, which was set in the controller is accessed in their page as above. 

<apex:commandButton action="{!SetFirstStep}" value=" << First " reRender="panelPDLPersonalChequeSteps" id="firstStepCommandLink"/> 

When the “panelPDLPersonalChequeSteps” panel is rendered, my “PDLPersonalChequesProcessStep1” page is supposed to be displayed. But they get the “under construction” error message.
Resolution
The above code would not work.

For example if your site is "yxz.force.com\test" and page is \apex\pagename. 
 
If we try to use <a href> and pass this to \apex\pagename it wont work on site as partial url takes up till .com 
 
For example, it will form url as yxz.force.com\apex\pagename 
 
But it should be:
 
yxz.force.com\test\apex\pagename 
 
This can be solved by using it dynamically, for example 
 
"{!URLFOR($Site.Prefix+'/VFPageName?opptyId='+Opportunity.Id)}". 
 
 




promote demote