<a4j:commandButton> doesn´t start the action
I need to use the a4j:commandButton
instead of h:commandButton
because of its reRender
option.
When I'm u开发者_StackOverflow社区sing h:commandButton
, it works fine (but off course without reRender):
<h:commandButton id="save" action="#{bean.save}" value="#{conf.buttonSave}"/>
And the same thing using doesn't (action isn't started even withour reRender option):
<a4j:commandButton id="save" action="#{bean.save}" value="#{conf.buttonSave}"/>
I've also tried:
<h:commandButton id="save" action="#{bean.save}" value="#{conf.buttonSave}">
<a4j:ajax event="click" reRender="table" />
</h:commandButton>
But if I add a4j:ajax
it the same problem as a4j:commandButton
, action is not started.
Could you help me?
You tagged this JSF 2.0. So you're using JSF 2.0. Just use the JSF 2.0 builtin <f:ajax>
tag.
<h:commandButton id="save" action="#{bean.save}" value="#{conf.buttonSave}">
<f:ajax render="table" />
</h:commandButton>
Note that <h:dataTable id="table">
must be within the same <h:form>
the above way. Otherwise you need render=":table"
instead. Also note that you must have a <h:head>
instead of <head>
in the template in order to get all necessary JavaScripts auto-included.
精彩评论