push --> onemesssage --> update!

UI Components for JSF
Post Reply
rulyone
Posts: 22
Joined: 18 Apr 2010, 05:23

25 Sep 2011, 19:41

Hi, there's one thing that's been bothering me with the use of prime push. How can I do something like this?

Code: Select all

<h:outputText id="some_id" value="#{myBean.number}" />
<h:outputText id="another_id" value="#{myBean.anotherNumber}" />

<p:push onmessageUpdate="some_id, another_id" channel="counter" /> 
look speccially on the sintax of "onmessageUpdate"... I made this up to see if you get my idea...

Is this possible? if not, is there a suggestion for doing this kind of stuff?

rulyone
Posts: 22
Joined: 18 Apr 2010, 05:23

26 Sep 2011, 22:35

bump

User avatar
kataras
Posts: 42
Joined: 12 Apr 2011, 21:51
Location: Xanthi/Greece
Contact:

27 Sep 2011, 13:40

agree , i am waiting for this ;)
PrimeFaces 3.0 RC1 version . Netbeans 7.0.1 . Apache Tomcat 7.0.22 . Firefox 7.0.1 & Google Chrome ,
Mandriva 2011 & Windows Home Server 2011 & Windows 8 Developer Preview .

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

27 Sep 2011, 15:04

You could call an remoteCommand onmessage.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

27 Sep 2011, 15:08

If you have "data" in "onmessage" handler, you can simple try to call

Code: Select all

$(#some_id).html(data);
Or do you want to update many targets? What do you expect in response exactly?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
kataras
Posts: 42
Joined: 12 Apr 2011, 21:51
Location: Xanthi/Greece
Contact:

27 Sep 2011, 15:17

I did it ! look at the end of topic : viewtopic.php?f=3&t=15169
PrimeFaces 3.0 RC1 version . Netbeans 7.0.1 . Apache Tomcat 7.0.22 . Firefox 7.0.1 & Google Chrome ,
Mandriva 2011 & Windows Home Server 2011 & Windows 8 Developer Preview .

rulyone
Posts: 22
Joined: 18 Apr 2010, 05:23

28 Sep 2011, 01:51

Oleg wrote:If you have "data" in "onmessage" handler, you can simple try to call

Code: Select all

$(#some_id).html(data);
Or do you want to update many targets? What do you expect in response exactly?
I want to update multiple targets... that's the problem. Icepush has a nice approach, but I don't want to use icefaces... and I don't know if prime push can do something like that

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

28 Sep 2011, 10:15

Just FYI: IcePush != ICEFaces. ICEPush is a single jar with no dependencies. ICEPush uses Long-Polling and OpenAjax-Protocol. It works in all browsers. If you want WebSocket, use something else - PrimePush or Atmosphere.

If you want to update multiply targets, you can create your data accordingly. It depends on you how you create nested structures.

Code: Select all

$(#some_id).html(data.target1);
$(#other_id).html(data.target2);
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 61 guests