【发布时间】:2014-04-20 06:21:30
【问题描述】:
我有一个<a4j:commandLink>,我需要在我的控制器上触发一个动作,
<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>
当我点击该链接时,onbegin javascript 被成功触发,但该操作从未被调用。这是我的控制器的操作:
public void send(String id, String guid) {
if (id != null && guid != null) {
...
}
}
我的 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>
【问题讨论】:
-
你不能使用 actionlistner 传递值,使用 action。更多详情见stackoverflow.com/questions/3909267/…