小编smo*_*999的帖子

JSF中的多个actionlisteners

我想在进一步处理之前使用多个动作侦听器来设置两个支持bean的状态

第一种方式:

<p:commandButton process="@this" >
   <f:attribute name="key" value="#{node.getIdTestGroup()}" />
   <f:actionListener binding="#{testController.nodeListener}" />
<f:actionListener binding="#{testDeviceGroupController.prepareCreate}" />
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)

它给出了一个例外:

警告:/ testGroup/List.xhtml @ 26,88 binding ="#{testController.nodeListener()}":找不到方法nodeListener javax.el.E​​LException:/testGroup/List.xhtml @ 26,88 binding ="#{ testController.nodeListener()}":找不到方法nodeListener

第二种方式:

<p:commandButton process="@this" >
    <f:attribute name="key" value="#{node.getIdTestGroup()}" />
    <f:actionListener binding="#{testController.nodeListener(event)}" />
    <f:actionListener binding="#{testDeviceGroupController.prepareCreate(event)}" />
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)

nodeListener和prepareCreate方法的事件为null

怎么做对吗?

jsf primefaces jsf-2

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

jsf ×1

jsf-2 ×1

primefaces ×1