JavaScript Error if no push element found

Push Framework with Atmosphere
Post Reply
matej.kosco
Posts: 6
Joined: 19 Jan 2012, 19:36

06 Jul 2012, 14:19

Hi all,

I found an issue in the push JavaScript.

I'm trying to send a push request from my backing bean

Code: Select all

RequestContext.getCurrentInstance().push("test", "update");
however, I get an error on line 410 in core.js

Code: Select all

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

matej.kosco
Posts: 6
Joined: 19 Jan 2012, 19:36

06 Jul 2012, 14:28

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

User avatar
optimus.prime
Prime
Posts: 17368
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Jul 2012, 15:13

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

matej.kosco
Posts: 6
Joined: 19 Jan 2012, 19:36

06 Jul 2012, 17:59

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

User avatar
optimus.prime
Prime
Posts: 17368
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Jul 2012, 12:44

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Yahoo [Bot] and 2 guests