2014-10-01 99 views
1

假設我們有一個自定義的salesforce控制器和一個自定義的visualforce頁面。在Visualforce頁面的末尾,我喜歡評估控制器的公共成員變量,如果它是真的,我喜歡將另一個Visualforce頁面(例如apex/test)的內容添加到第一頁。如何根據條件將Visualforce頁面添加到現有頁面的末尾?

<apex:page controller="mycontroller"> 
........... 
my tags and page contents comes here 
........... 

{!if(my_member_variable == true, attach contents of "apex/test" page to end of this page, "do nothing")} 

</apex:page> 

我該怎麼做?

簡而言之,我正在尋找一個類似於用於visualforce的PHP的include()命令。

感謝,

回答

0

聽起來像是你要使用沿着apex:include其渲染屬性。

<apex:page controller="mycontroller"> 
    <!-- ... --> 
    <apex:include pageName="TheNameOfTheIncludedPage" rendered="{!my_member_variable}"/>  
</apex:page> 

順便說一句。 salesforce.stackExchange.com是向Salesforce提出特定問題的好地方。

相關問題