Is it possible to load p:growl when the page is load
-
- Posts: 280
- Joined: 25 Jun 2010, 01:18
When the load a page, the init() method with @PostConstruct check certain parameter. If something wrong, I will send a FacesMessage. But I cant get p:growl to load that FacesMessage. Is it possible?
Mojarra 2.1.10, Glassfish 3.1, Tomcat 7, Primeface 3.3.1
IE 6-8, FireFox 10-13
MAC OSX Lion, Windows XP, 7
- bumble.bee
- Posts: 723
- Joined: 29 Sep 2010, 21:39
- Location: United States
You might want to use the preRenderView system event of JSF 2 to do something before a page is rendered.
I don't think the @PostConstruct will always get called every time the page loads. In the event the bean has a scope that spans multiple requests there may only be one time when it is callled. I believe the method annotated with @PostConstruct is called right after the bean has objects injected.
Put a System.out.println in your @PostConstruct method and see when it is getting called.
I don't think the @PostConstruct will always get called every time the page loads. In the event the bean has a scope that spans multiple requests there may only be one time when it is callled. I believe the method annotated with @PostConstruct is called right after the bean has objects injected.
Put a System.out.println in your @PostConstruct method and see when it is getting called.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hey Cagthay.
Where's the bean(s) for the mac demo from the above link? The xhtml source is included in the demo, but I was looking for the backing bean. Specifically I was looking for the growl on page load implementation.
Where's the bean(s) for the mac demo from the above link? The xhtml source is included in the demo, but I was looking for the backing bean. Specifically I was looking for the growl on page load implementation.
3.3.1
WebSphere 7
Mojarra 2.0.4
From another forum member:
I've just fixed the problem on IE7...
I personally hate IE7 with all my heart but still need to support it for some time.
WebSphere 7
Mojarra 2.0.4
From another forum member:
I've just fixed the problem on IE7...
I personally hate IE7 with all my heart but still need to support it for some time.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Checkout showcase to get all the source;
Code: Select all
svn co https://primefaces.googlecode.com/svn/examples/trunk/showcase primefaces-showcase
Yeah sorry about that. I forgot. The problem I have is that I am behind a proxy at work that I have zero influence over or information of. So I have to go through with firebug and accept many or most of the 407's in a separate tab then reload the page. I could pull the code base if I could install tortoise (without filing a bunch of forms I can't). Not your fault, but it is easier for me if the information I am looking for is displayed like in the showcase. Speaking of which, thanks for having a show case. That helps a lot.
To clarify I was able to view the backing bean for the macosx showcase by opening all the js dependencies in another tab first then reloading the original page.
To clarify I was able to view the backing bean for the macosx showcase by opening all the js dependencies in another tab first then reloading the original page.
3.3.1
WebSphere 7
Mojarra 2.0.4
From another forum member:
I've just fixed the problem on IE7...
I personally hate IE7 with all my heart but still need to support it for some time.
WebSphere 7
Mojarra 2.0.4
From another forum member:
I've just fixed the problem on IE7...
I personally hate IE7 with all my heart but still need to support it for some time.
I looked over the source of the page:
<p:growl showDetail="true" sticky="true"/>
public class MacosxBean {
private String text;
public MacosxBean() {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Software Update", "New version of iTunes is available"));
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Software Update", "New version of PrimeFaces is available"));
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
There isn't an id of growl, there isn't update="growlIDxxx" to trigger the growl. How is it possible to load growl when the page is load?
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
-
- Information
-
Who is online
Users browsing this forum: No registered users and 55 guests