PF push javascript API

UI Components for JSF
Post Reply
prompt
Posts: 5
Joined: 22 Sep 2014, 08:35

29 Jul 2016, 18:22

Hi. I've faced issues on working with 'push' api in push.js.
According to Primefaces User Guide this method takes a json as parameter; but it seems has no effect at all.
Socket component is as follows:

Code: Select all

<p:socket channel="/people/#{account.info._id}" autoConnect="true" onMessage="socketHandler"
                  widgetVar="websocket"></p:socket>

<script>
var ws = PF('websocket');

// JSON.stringify is used based on atmosphere js solution!
// Also tested ws.push({ content: "hello" });
ws.push(JSON.stringify({ content: "hello" }));
</script>
No request is made upon this execution. Could you please help me on this issue?
Thanks in advance!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests