<a4j:commandLink> action not fired

久未见 提交于 2019-12-12 05:48:27

问题


I have an <a4j:commandLink> which I need to fire an action on my controller,

<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>

When I click on the link, the onbegin javascript is successfully fired but the action is never called. Here is my action from my controller:

public void send(String id, String guid) {
    if (id != null && guid != null) {
        ...
    }
}

My viewBean is view scoped and the guid comes from the component... What am I missing here?

EDIT

If I change the link to a button it works... but I need a link:

<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>

回答1:


According to documentation :

"MethodExpression representing an action listener method that will be notified when this component is activated by the user. The expression must evaluate to a public method that takes an ActionEvent parameter, with a return type of void."

javax.el.MethodExpression (signature must match void actionListener(javax.faces.event.ActionEvent))



来源:https://stackoverflow.com/questions/22413820/a4jcommandlink-action-not-fired

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!