Board index JavaServer Faces Push JavaScript Error if no push element found

JavaScript Error if no push element found

Push Framework with Atmosphere


Posts: 6
Hi all,

I found an issue in the push JavaScript.

I'm trying to send a push request from my backing bean
RequestContext.getCurrentInstance().push("test", "update");

however, I get an error on line 410 in core.js
PrimeFaces.websockets[channel].send(message);

Uncaught TypeError: Cannot call method 'send' of undefined

PrimeFaces.websockets[channel] gets created with the PrimeWebSocket widget but there is no <p:push/> element in my .xhtml file (yet), hence the error.

reproduced in Chromium 18 and Firefox 13

Thanx for fixing,
Matej
Primefaces 3.3.1, MyFaces 2.0.4, Jetty 8


Posts: 6
btw. can anybody suggest how to override the code without having to copy the wholle PrimeFaces.ajax.AjaxUtils?
Unfortunately I can't extend it since it doesn't use the Class.extend() function

thanks
Primefaces 3.3.1, MyFaces 2.0.4, Jetty 8


Posts: 15059
Location: Cybertron

Better to wait for PrimeFaces 3.4 as it is being reimplemented now based on atmosphere.
PrimeFaces Lead


Posts: 6
will do. thanks!
Primefaces 3.3.1, MyFaces 2.0.4, Jetty 8


Posts: 15059
Location: Cybertron

This and many other limitations are fixed now in PrimeFaces 3.4.
PrimeFaces Lead


Return to Push