Hi,
I have a multipage application, using p:commandbutton action="bean.navigate()" to navigate.
In the bean.navigate I'm adding a global flash message but the message is not displayed in the second view.
It needs a page refresh.
Navigating to a separate page, adding a global flash message it's ok.
Any recommendations are appreciated.
br hw
Multipage and Flash messages
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
please share your primefaces mobile xhtml and this bean.navigate(), too.
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
Hi and thanks for answering.smithh032772 wrote:please share your primefaces mobile xhtml and this bean.navigate(), too.
xhtml code is simple:
Code: Select all
<h:body>
<p:growl id="messages" autoUpdate="true" globalOnly="true"/>
<pm:page id="first">
<pm:header id="header">
Header
</pm:header>
<pm:content id="content">
<h:form id="form">
<p:commandButton value="action" action="#{messageController.addMessage()}"/>
</h:form>
</pm:content>
<pm:footer id="footer">
Footer
</pm:footer>
</pm:page>
<pm:page id="second">
<pm:header id="header">
Header
</pm:header>
<pm:content id="content">
Contant Page 2
</pm:content>
<pm:footer id="footer">
Footer
</pm:footer>
</pm:page>
</h:body>
Code: Select all
public String addMessage() {
log.info("Adding message");
Messages.addFlashGlobalInfo("A Flash message");
return "pm:second";
}
Does'nt really matter where I put the growl, it's not shown.
A sample project is here:
https://github.com/hwaastad/MobileMessages.git
just do a mvn tomee:run and it's deployed on ROOT.
br hw
Hi,kukeltje wrote:I never used flash scope, but from what I read it is used to have messages survive a jsf http page redirect. The Mobile pages work differently and a normal message should suffice.
yes that's what I would expect, but still creating a normal facesmessage, growl still is not showing.
br hw
-
- Posts: 2
- Joined: 02 Jul 2015, 09:34
I read it is used to have messages survive a jsf http page redirect.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests