I'm using JSF2.2 and PrimeFaces 5.2 and I have a list of chackboxes which posts a request via
<p:ajax listener="#{packageListBean.filterResults()}" update="@form" process="@this"/>
Every time a post happens the @PostConstruct method of the been is invoked but not the listener.
the bean is anotated with :
import javax.faces.view.ViewScoped;
import javax.inject.Named;
It is very strange as I would expect the @PostConstruct method to be invoked only on the first GET reqest of the page.
Added after BalusC comment:
I'm including jquery like this:
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
If I issue the request by f:ajax then the code works ok and @PostConstruct is called only once and also the listener is called.
This is the request made with p:ajax
POST /index.jsf HTTP/1.1
Host: cloudflow-backend-local.arctur.net:8080
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: application/xml, text/xml, */*; q=0.01
Accept-Language: sl,en-GB;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Faces-Request: partial/ajax
X-Requested-With: XMLHttpRequest
Referer: http://cloudflow-backend-local.arctur.net:8080/index.jsf
Content-Length: 280
Cookie: lng=sl; **************.*****
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
and this is a request made by f:ajax
POST /index.jsf HTTP/1.1
Host: cloudflow-backend-local.arctur.net:8080
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: sl,en-GB;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Faces-Request: partial/ajax
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Referer: http://cloudflow-backend-local.arctur.net:8080/index.jsf
Content-Length: 498
Cookie: lng=sl; ****************.*******
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache