如何添加按钮或链接到标准控制器与应用选项卡不同的 Visualforce 页面?
我有使用 CompSearchDummy__c
作为标准控制器的 Visualforce 页面 CompetitorSearch.page
。
<apex:page StandardController="CompSearchDummy__c" extensions="CompetitorSearch">
如果我要在 CompSearchDummy
页面上添加自定义按钮,CompetitorSearch.page
将显示为页面目标。
但是我有使用 Talent__c sObject
的 Talent
页面,当我尝试添加自定义按钮并尝试设置目的地时,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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解你的问题,你想添加一个
apex:commandButton
来转到另一个页面。当您位于同一页面时,它只是自行刷新,但要转到另一个页面,您需要在apex:commandButton
中指定一个操作,该操作指向控制器扩展中返回的方法您想去的地方的页面参考。像这样:注意,如果您并不真正需要按钮或特殊逻辑,而只想转到另一个页面,则只需使用
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 theapex:commandButton
that points to a method in a controller extension that returns a PageReference for where you want to go. Like this: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: