【问题标题】:How to add a visualforce page to the end of existing page according to a condition?如何根据条件将visualforce页面添加到现有页面的末尾?
【发布时间】:2014-10-01 18:49:19
【问题描述】:

假设我们有一个自定义的 salesforce 控制器和一个自定义的 visualforce 页面。在 visualforce 页面的末尾,我喜欢评估控制器的公共成员变量,如果它是真的,我喜欢将另一个 visualforce 页面(例如 apex/test)的内容添加到第一页。

<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() 的命令。

谢谢,

【问题讨论】:

    标签: salesforce apex-code visualforce


    【解决方案1】:

    听起来您想使用 apex:include 及其渲染属性。

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

    顺便说一句。 salesforce.stackExchange.com 是询问 Salesforce 特定问题的好地方。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多