I used primefaces 5.1 and Atmosphere 2.2.2
In the Notify case of PUSH showcase,the Notify message will show in p:growl when NotifyView's send() method is invoked,And the p:growl is updated.always only one the p:growl.
I want let the p:growl is showing in new one,not update in the only one when every time the send() is invoked.
could somebody help me?tell me how to do it ?
how to let published message show in other new p:growl?
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
Look at the facesmessage code in primefaces push section of PrimeFaces 5.1 user guide, use that code, and modify it a little.
growl one
growl two
p:socket
javascript: global variable (whichGrowlToUse) and handleMessage()
growl one
Code: Select all
<p:growl widgetVar="growl1" showDetail="true" />
Code: Select all
<p:growl widgetVar="growl2" showDetail="true" />
Code: Select all
<p:socket onMessage="handleMessage" channel="/notify" />
Code: Select all
<script type="text/javascript">
var whichGrowlToUse = "growl1";
function handleMessage(facesmessage) {
facesmessage.severity = 'info';
if (whichGrowlToUse == "growl1") {
PF('growl1').show([facesmessage]);
whichGrowlToUse = "growl2";
}
else {
PF('growl2').show([facesmessage]);
whichGrowlToUse = "growl1";
}
}
</script>
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Information
-
Who is online
Users browsing this forum: No registered users and 54 guests