+ Start a Discussion
Tobias HaggeTobias Hagge 

Display VF page on VF page

Hello. Is it possible (and how) to display (render) a VF page on another VF page?

Example:
<apex:page>   

<apex:pageblock>
</apex:pageblock>


Render Visualforce here


<apex:pageblock>
</apex:pageblock>

</apex:page>

 
RamuRamu (Salesforce Developers) 
Strange, why do you want a visualforce page within another visualforce page. You can merge the login into a single VF page. 

You can rather include a template in visualforce page. The below article shows more on this

https://www.salesforce.com/us/developer/docs/pages/Content/pages_templates_composition.htm
Gouranga SadhukhanGouranga Sadhukhan
Yes. We can
<apex:page controller="mycontroller">
        <apex:form id="form">
            <apex:pageBlock >
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel >Objects</apex:outputLabel>
                        <apex:selectList size="1" value="{!currentobject}">
                            <apex:selectOptions value="{!objects}"/>
                            <apex:actionSupport event="onchange" action="{!loadfields}" reRender="form"/>
                        </apex:selectList>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel >Field</apex:outputLabel>
                        <apex:selectList size="1" value="{!currentfield}">
                            <apex:selectOptions value="{!fields}"/>
                        </apex:selectList>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
            </apex:pageBlock>
             <apex:pageBlock >
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel >Objects</apex:outputLabel>
                        <apex:selectList size="1" value="{!currentobject}">
                            <apex:selectOptions value="{!objects}"/>
                            <apex:actionSupport event="onchange" action="{!loadfields}" reRender="form"/>
                        </apex:selectList>
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel >Field</apex:outputLabel>
                        <apex:selectList size="1" value="{!currentfield}">
                            <apex:selectOptions value="{!fields}"/>
                        </apex:selectList>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
            </apex:pageBlock>
        </apex:form>
    </apex:page>
Gouranga SadhukhanGouranga Sadhukhan
You Can used apex:iframe
Tobias HaggeTobias Hagge
Using apex:iframe is the quickest, easiest for me to implement. I am a bit concerned though if loading a VF page on update with multiple different additional VF pages will cause any performance issues. F.e. if it may take much longer to fully being rendered.