Salesforce <;顶点:命令按钮>;不起作用
我正在做按钮 我的组件代码如下Salesforce <;顶点:命令按钮>;不起作用,salesforce,Salesforce,我正在做按钮 我的组件代码如下 <apex:commandButton action="{!sendAction}" value="SEND" styleClass="Button" rerender="messageId" immediate="true"/> <apex:outputpanel rendered="{!showmsg}" id="messageId"> <apex:outputtext value="{!outputM
<apex:commandButton action="{!sendAction}"
value="SEND" styleClass="Button" rerender="messageId" immediate="true"/>
<apex:outputpanel rendered="{!showmsg}" id="messageId">
<apex:outputtext value="{!outputMessage}" style="color:red;font-size:13px;font-weight:bold;"/>
<br />
</apex:outputpanel>
public PageReference sendAction()
{
showmsg=true;
outputMessage='working';
return null;
}
但是我的操作方法sendAction没有被调用。
当我打开包含在新窗口中的页面时,函数被调用。但在同一个窗口中,它不会被调用
非常感谢您的帮助。如果正如Matthew已经暗示的那样,您的页面或组件引用了您的控制器,我相信这可能是由showmsg变量引起的 如果messageId outputpanel由于showMsg最初为false而未呈现,则它也不会重新呈现,因此不会显示您的消息。如果我是对的,以下内容将更有意义,并解决您的问题
<apex:outputpanel id="messageId">
<apex:outputtext rendered="{!showmsg}" value="{!outputMessage}" style="color:red;font-size:13px;font-weight:bold;"/>
<br />
</apex:outputpanel>
在链接时,您可以尝试以下方法
您是否在页面标签上指定了
controller=“Your controller Name”
或extension=“Your controller extension Name”
tag@dip你试过我的建议了吗?