0

I am a little confused about the attribute actionListener in p:ajax, it does not appear in the taglib of primefaces 5.2.2 and Eclipse thinks so too because it marks it as not existing. primefaces-p:ajax attributesn

But the code works, the method in the bean is called with an ActionEvent parameter.

<p:ajax event="change" actionListener="#{bean.actionlistenerMethod}" update="stuff" />

So my question is, how can the actionListener work?

Primefaces: 5.2.2
JSF: 2.1.16
JBoss EAP 6.1

Ande Hofer
  • 150
  • 2
  • 14

1 Answers1

2

As you can see in the taglib and the doc the correct attribute to use would be "listener". Maybe they have covered "actionListener" in the backend just to ommit that kind of errors.

Przemek
  • 623
  • 2
  • 11
  • 24
  • Hello, the problem is that I am migrating a richfaces 3.3.3 project and I would prefer not to touch the beans to much. So when I use the listener attribute I can not use the bean method because it needs an ActionEvent parameter. So I am not unhappy that the actionListener works, but I can not see how. – Ande Hofer Jun 08 '20 at 10:50
  • We have this in our code even in PF 8. The "listener" is called without ActionEvent param and best used in combination with "event". "actionListener" is not in the TagLib but works and sends the ActionEvent param. Maybe just take a look over here : https://stackoverflow.com/a/21451599/223788 – Przemek Jun 08 '20 at 11:28