Bean state saving / conversation

UI Components for JSF
Walter.Mourao
Posts: 23
Joined: 15 Dec 2009, 13:28
Location: Brazil
Contact:

15 Dec 2009, 13:36

Hi folks,
does PrimeFaces has something to save the current state of a bean, like the Tomahawk's <t:saveState/> or some kind of conversational scope, like the Trinidad's pageFlowScope ? If not, what do you suggest I use to get the same functionality ?

Thanks in advance,
Walter Mourão

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

16 Dec 2009, 02:05

Hi Walter,

Since PrimeFaces is UI specific we don't have any plans to add features like that. However you have many alternatives;

- PrimeFaces Optimus ViewScope
- Seam ViewScope-ConversationScope
- Spring WebFlow
- CDI (Java EE 6) Conversation Scope
- JSF 2.0 Built-in View Scope
- MyFaces Orchestra

Same problem solved too many times :)

Turjakas
Posts: 48
Joined: 22 Jan 2010, 17:07

26 Jan 2010, 18:03

I'm using Spring to manage my beans and therefore I'd also like to use Spring to manage the scope of the beans. The built-in scopes such as "request" and "session" work fine, but I'm still missing conversation, view and probably even flash scope.

Can anyone provide me ideas on how to implement these as Spring custom scopes or if there are custom scope implementations for Spring that integrate with the new JSF 2.0 scopes?

I cannot use Spring Web Flow as I have already found it incompatible with the AJAX features of PrimeFaces or any other decent JSF component library. Also, Web Flow 2.x has no support JSF 2.0.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

26 Jan 2010, 20:15

Yes as core Spring doesn't handle JSF integration well it only provides request, session and application scopes. For view scope you can use;

http://www.jroller.com/RickHigh/entry/a ... view_scope

For flash and conversation scope, you need to implement it yourself. There's also MyFaces orchestra project that gives you view and conversation scopes but I'm not sure if it's compatible with JSF 2.0.

Nowadays the hot topic is CDI as it enhanced JSF 2.0 a lot with lots of new features but since you're on the spring side, it's not applicable.

Another alternative is to use seam for JSF related stuff and use seam's spring integration module. I never tried this though.

I'd stay away from spring webflow as it causes more problems than it solves, spring faces project also seems like a proof of concept work, not production ready.

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

26 Jan 2010, 23:42

MyFaces Orchestra compatible with JSF 2. It's even independ on UI Framework and it works with Spring used as replacement for Managed Bean Creation Facility.
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

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Jan 2010, 15:09

Good to know that it's compatible with JSF 2.

bluesturbo
Posts: 52
Joined: 30 Nov 2009, 17:10

27 Jan 2010, 16:32

Everyone, would strongly suggest using the JEE 6 "CDI" JSR-299 standard. Just google it to see all the information, works perfect with JSF 2. Reza has a good article: http://www.theserverside.com/tt/article ... ninJavaEE6

When you realize how JSF 2 with JSR-299 works and (Comet) AJAX push, it's like developing a native client application!

Seam 3 is going to be built on JSR-299 (inspired by Gavin King).

Think Cagatay was going to make a sample - PrimeFaces/Weld/JPA application.
NetBeans 7 Maven PrimeFaces-3.0.M2-SNAPSHOT, JPA 2.0, GlassFish 3.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

27 Jan 2010, 17:37

CDI looks very cool, there's already some work on CDI-PrimeFaces example which will be published soon.

henry_ken
Posts: 2
Joined: 21 Apr 2010, 08:29

21 Apr 2010, 08:44

any progress on the example of CDI and PrimeFaces integration?

i tried to use ConversationScoped with PrimeFaces Ajax call, but it does not work since it cannot retrieve the conversation id from the request.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 Apr 2010, 00:44

There is an article here;

http://olex.openlogic.com/wazi/2010/get ... with-jee6/

Hope this helps;

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests