Hope this helps. Kindly mark this as solved if the reply was helpful. Thanks, Nagendra  ", "upvoteCount": 1, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T40ySSAR", "datePublished": "2018-10-08T05:08:25.000Z", "author": { "@type": "Person", "name": "Nagendra Babu Pilli", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000CO9yeQAD", "affiliation": { "@type": "Organization", "name": "Salesforce" } } }, "suggestedAnswer": [] } } Skip to main content
Hi All,

I have two visual force page as seen below,

<apex:page tabStyle="Case" action="/500?fcf=00B7F00000287BO" ></apex:page>

<apex:page showHeader="true" tabstyle="Case" action="/500?fcf=00B0l0000010NyT"></apex:page>

Is there a way to club these two VF page into one. I tried Apex: Include but doesn't work.

I heard about iframe, but I don't have any idea on this.

Can someone help me to achieve this one?

Thanks in advance.

 
4 件の回答
  1. 2018年10月8日 5:08
    Hi Manoj,

    You can use the apex:include tag. Please refer to the Salesforce Docs https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/ for further details https://developer.salesforce.com/docs/atlas.en-us.workbook_vf.meta/workbook_vf/workbook_retired.htm

    . If you want to dynamically display the pages based on the option selected, here is a simple solution for that:

    <apex:page>

    <input type="checkbox" id="option1" onclick="displayPage();">option1</input> <input type="checkbox" id="option2" onclick="displayPage();"> option2 </input>

    <div id="option1Page" style="display:none;">

    <apex:include pageName="vfpage1"/>

    </div>

    <div id="option2Page" style="display:none;">

    <apex:include pageName="vfpage2"/>

    </div>

    <script type="text/javascript">

    function displayPage() {

    if (document.getElementById('option1').checked ) {

    document.getElementById('option1Page').style.display = "block";

    document.getElementById('option1').checked=true;

    }

    else

    {

    document.getElementById('option1').checked=false;

    document.getElementById('option1Page').style.display = "none";

    }

    if (document.getElementById('option2').checked )

    {

    document.getElementById('option2Page').style.display = "block";

    document.getElementById('option2').checked=true;

    }

    else

    {

    document.getElementById('option2').checked=false;

    document.getElementById('option2Page').style.display = "none";

    }

    }

    </script>

    </apex:page>

    Hope this helps.

    Kindly mark this as solved if the reply was helpful.

    Thanks,

    Nagendra

     
0/9000