Tôi muốn sử dụng nhiều người nghe hành động để thiết lập trạng thái của hai đậu ủng hộ trước khi tiếp tục xử lýNhiều actionlisteners trong JSF
cách 1:
<p:commandButton process="@this" >
<f:attribute name="key" value="#{node.getIdTestGroup()}" />
<f:actionListener binding="#{testController.nodeListener}" />
<f:actionListener binding="#{testDeviceGroupController.prepareCreate}" />
</p:commandButton>
Nó đưa ra một ngoại lệ:
CẢNH BÁO : /testGroup/List.xhtml @ 26,88 binding = "# {testController.nodeListener()}": Phương thức nodeListener không tìm thấy javax.el.ELException: /testGroup/List.xhtml @ 26,88 binding = "# { testController.nodeListen er()} ": Phương pháp nodeListener không tìm thấy
Cách 2:
<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>
tổ chức sự kiện là null trên nodeListener và prepareCreate phương pháp
Làm thế nào để làm điều đó có đúng không?
liên quan: http://stackoverflow.com/questions/3909267/differences-between-action-and- actionlistener/3909382 # 3909382 – BalusC