I have a form containing several h:commandButtons - all have f:ajax tags attached. When I trigger one of these command buttons, then I see in the log that all are actualy getting fired - so all actions are called?
Is this normal behaviour of the h:commandButton + f:ajax combination?
I'm using action attribute of commandButton and not the listener on f:fajax.
Hope someone can explain this to me.
Thanks in advance.
/Søren
EDIT:
Simplified code:
<h:form>
<ui:repeat ...>
<h:inputText value="#{order.quantity}"/>
</ui:repeat>
<h:commandButton type="button" action="#{facade.updateOrderItems()}" value="Update">
<f:ajax execute="@form" render=":orderList" onevent="onAjaxEvent"></f:ajax>
</h:commandButton>
<h:commandButton type="button" action="#{facade.deleteSelectedOrderItems(order)}" value="Delete">
<f:ajax execute="@form" render=":orderList" onevent="onAjaxEvent"></f:ajax>
</h:commandButton>
<h:commandButton type="button" action="#{facade.addOrdersItemsToWishList(order)}" value="Add to wish list"> <f:ajax execute="@form" render=":orderList" onevent="onAjaxEvent"></f:ajax>
</h:commandButton>
</h:form>
When I click the Update button it seems the Delete and Add to wish list buttons gets called as well...?
immediate=true
in your<h:commandButton>
like this<h:commandButton immediate=true action=..../>
– Anas