且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调用 使用 <f:ajax> 的动作方法

更新时间:2022-06-13 23:15:58

您需要使用 event="action" 而不是 event="click".你甚至可以完全省略它.这是 在嵌套在 UICommand 组件中时监听的默认事件.

You need to use event="action" instead of event="click". You could even omit it altogether. It's namely the default event the <f:ajax> is listening on when nested in an UICommand component.

<h:commandLink action="#{testBean.showSomething}">
    <f:ajax render=":content" />
    Do Stuff
</h:commandLink>