Bean scope for Schedule

UI Components for JSF
Post Reply
monkeymagoo
Posts: 18
Joined: 21 Apr 2012, 22:27

15 May 2012, 01:59

Hi

I thought I had Schedule working. But after leaving the page and coming back, my calendar is empty even though I have events.

The showcase doesn't show the bean scopes. Please could someone tell me the recommended scope (Request, View, Session etc) and also whether I should be using ManagedBean of CDI's Named annotations?

Thanks
Primefaces 3.5. Mojarra 1.2.19. Netbeans 7.1.1. Glassfish 3.1.2.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

15 May 2012, 03:33

monkeymagoo wrote:Please could someone tell me the recommended scope (Request, View, Session etc) and also whether I should be using ManagedBean of CDI's Named annotations?
Try all of them and see which one works best for you and your requirement.
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

monkeymagoo
Posts: 18
Joined: 21 Apr 2012, 22:27

15 May 2012, 11:34

OK, thanks. So there isn't a particular recommended scope and they all should (potentially) work, depending on the use case of course?

I think ViewScoped makes the most sense for me. I would like to use CDI if possible as it sounds like that's preferred over ManagedBean.

I'll try and get it working using those.
Primefaces 3.5. Mojarra 1.2.19. Netbeans 7.1.1. Glassfish 3.1.2.

monkeymagoo
Posts: 18
Joined: 21 Apr 2012, 22:27

15 May 2012, 14:59

In case this helps someone else, my problems were (very basic): I was importing javax.annotation.ManagedBean, not javax.faces.ManagedBean (which is the one that works).

Arrrggggg, too many classes with the same name! :D
Primefaces 3.5. Mojarra 1.2.19. Netbeans 7.1.1. Glassfish 3.1.2.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

15 May 2012, 16:48

Thanks for responding with your code changes which fixed the problem.
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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests