如何添加按钮或链接到标准控制器与应用选项卡不同的 Visualforce 页面?

发布于 2024-10-03 07:32:19 字数 562 浏览 4 评论 0原文

我有使用 CompSearchDummy__c 作为标准控制器的 Visualforce 页面 CompetitorSearch.page

<apex:page StandardController="CompSearchDummy__c" extensions="CompetitorSearch">

如果我要在 CompSearchDummy 页面上添加自定义按钮,CompetitorSearch.page 将显示为页面目标。

但是我有使用 Talent__c sObjectTalent 页面,当我尝试添加自定义按钮并尝试设置目的地时,CompetitorSearch.page 不显示作为一个选项,因为我没有将 Talent__c 设置为 标准控制器

是否可以以某种方式将我的 CompetitorSearch.page 链接添加到人才页面?

I have visualforce page CompetitorSearch.page that use CompSearchDummy__c as standard controller.

<apex:page StandardController="CompSearchDummy__c" extensions="CompetitorSearch">

If I am to add custom button on the page of CompSearchDummy, CompetitorSearch.page shows up for the page destination.

But I have Talent page which use Talent__c sObject and when I tried to add custom button and attempt to set destination, CompetitorSearch.page does not show up as an option because I did not set Talent__c as standard controller.

Is it possible to somehow add my CompetitorSearch.page link to Talent page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

允世 2024-10-10 07:32:19

如果我正确理解你的问题,你想添加一个 apex:commandButton 来转到另一个页面。当您位于同一页面时,它只是自行刷新,但要转到另一个页面,您需要在 apex:commandButton 中指定一个操作,该操作指向控制器扩展中返回的方法您想去的地方的页面参考。像这样:

<apex:commandButton action="{!gotoCompetitorSearch}" value="Competitor Search" />

public PageReference gotoCompetitorSearch() {
    return Page.CompetitorSearch;
}

注意,如果您并不真正需要按钮或特殊逻辑,而只想转到另一个页面,则只需使用 apex:outputLink 即可完成此操作,无需控制器扩展, 像这样:

<apex:outputLink value="{!$Page.CompetitorSearch}">CompetitorSearch</apex:outputLink>

If I understand your question correctly, you want to add an apex:commandButton to go to another page. When you were on the same page, it was just refreshing itself, but to go to another page, you need to specify an action in the apex:commandButton that points to a method in a controller extension that returns a PageReference for where you want to go. Like this:

<apex:commandButton action="{!gotoCompetitorSearch}" value="Competitor Search" />

public PageReference gotoCompetitorSearch() {
    return Page.CompetitorSearch;
}

Note, if you don't really need a button or special logic and just want to go to another page, you can do this with just an apex:outputLink with no need for a controller extension, like this:

<apex:outputLink value="{!$Page.CompetitorSearch}">CompetitorSearch</apex:outputLink>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文