Jsf 2 <;a4j:commandLink>;行动未被激发
我有一个Jsf 2 <;a4j:commandLink>;行动未被激发,jsf-2,richfaces,Jsf 2,Richfaces,我有一个,我需要在我的控制器上启动一个操作 <h:form> <a4j:commandLink actionListener="#{controller.send(viewBean.id, cc.attrs.guid)}" onbegin="$.efc.busy($.messages.sending);" oncomplete="$.efc.busy('', true);"> Send offer t
,我需要在我的控制器上启动一个操作
<h:form>
<a4j:commandLink
actionListener="#{controller.send(viewBean.id, cc.attrs.guid)}"
onbegin="$.efc.busy($.messages.sending);"
oncomplete="$.efc.busy('', true);">
Send offer to this dealer
</a4j:commandLink>
</h:form>
我的viewBean是视图范围的,guid来自组件。。。我错过了什么
编辑
如果我将链接更改为按钮,它将工作。。。但我需要一个链接:
<a4j:commandButton
action="#{controller.send(viewBean.id, cc.attrs.guid)}"
onbegin="$.efc.busy($.messages.sending);"
oncomplete="$.efc.busy('', true);"
value="Send offer to this dealer">
</a4j:commandButton>
根据文档: MethodExpression表示用户激活此组件时将通知的操作侦听器方法。该表达式的计算结果必须是采用ActionEvent参数的公共方法,返回类型为void
javax.el.MethodExpression
(签名必须与void actionListener(javax.faces.event.ActionEvent
)匹配)无法使用actionlistner传递值,请使用action。有关更多详细信息,请参阅使用
是否可以实现我想要的功能?我试着用一个动作代替一个动作监听器,但也没能让它起作用。我最终切换到一个样式类似like的
,称为
onClick。不优雅的解决方案是同时使用链接和按钮。带有样式显示的按钮:将不隐藏任何按钮。a4j:commandLink带有onClick javascript,它将在按钮上触发onClick事件并触发往返。a4j:commandLink的操作属性必须计算不带参数并返回对象的公共方法。它用于导航目的。
<a4j:commandButton
action="#{controller.send(viewBean.id, cc.attrs.guid)}"
onbegin="$.efc.busy($.messages.sending);"
oncomplete="$.efc.busy('', true);"
value="Send offer to this dealer">
</a4j:commandButton>