一些命令按钮'在我将actionListener
标记添加到process="@this"
标记之前,我的JSF应用的xhtml页面的<p:commandButton..
事件无效。我想知道为什么。在任何一个例子中我都没有看到这一点。我正在使用JSF 2.2&amp;组合CDI,以及JBoss 7.1运行时的Primefaces 5.0。我的bean是CDI @javax.inject.Named
bean,范围是@javax.enterprise.context.RequestScoped
..
答案 0 :(得分:1)
以下是您需要向process="@this"
添加属性<p:commandButton>
的原因的说明:Why to add process="@this" explicitly to p:commandButton to get action invoked?
答案 1 :(得分:1)
你没必要!
PrimeFaces commandButton的默认行为是process="@form"
,因此将处理整个表单。如果在将行为明确更改为process="form"
时未调用actionListener,但在将其更改为process="@this"
时调用,则通常会指示某些验证错误或类似错误。
要对此进行测试,只需在页面中添加<p:messages autoUpdate="true">
,您就会看到可能出现的所有错误消息。
修复这些确认和/或验证错误,即使您没有明确添加进程属性,也会看到您的操作正在被调用。