3
我有一个包含几个h:commandButtons的表单 - 都附有f:ajax标签。当我触发其中一个命令按钮时,我在日志中看到所有实际上都被解雇了 - 所有的操作都被调用了?JSF h:commandButton在表单中触发其他命令按钮?
这是h:commandButton + f:ajax组合的正常行为吗?
我正在使用commandButton的action属性,而不是f:fajax上的侦听器。
希望有人能向我解释这一点。
在此先感谢。
/索伦
编辑:
简化代码:
<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>
当我点击更新按钮似乎删除和添加到意愿清单按钮被调用以及.. 。?
这很奇怪。发布显示此错误的代码示例。 –
尝试在你的''中使用'immediate = true'这样的 ' ' –
Anas
immediate = true解决了部分问题。其他按钮没有执行 - 但是我的inputText值没有在bean中设置:-(如果我用@替换@表单,那么似乎所有东西都在工作,但是我又没有将数据导入到我的bean中。 .. – sorenchristensen