-
1. Re: Help me design a conversation scope using a4j:KeepAlive
fabmars Mar 27, 2008 10:53 AM (in response to hbmailinglist)Imo "visit" should be reinstanciated upon navigation.
keepAlive is only to prevent reinstanciation at each ajaxRequest on one same page, that is it enables making conversation scoped beans. I'm not an expert of the whole RF platform but if you change pages, this is a new non-ajax request, and thus we're not in a conversation anymore and the bean should be reinstanciated.
That said, you may access any value by:FacesContext facesContext = FacesContext.getCurrentInstance(); ELContext elContext = facesContext.getELContext(); ValueExpression ve = facesContext.getApplication().getExpressionFactory().createValueExpression(elContext, #{visit}, Visit.class); Visit visit = (Visit)ve.getValue(elContext); //here comes your instance
-
2. Re: Help me design a conversation scope using a4j:KeepAlive
hbmailinglist Mar 27, 2008 12:09 PM (in response to hbmailinglist)Thanks for your input...you are correct, keepAlive tag isn't going to help me with what I want.
Is there a way I can create a conversational state using richfaces or myfaces? I really don't want to use yet another framework, just because I need conversational state...
Any ideas?
Thanks
P.S. Thank you for the sample code...it worked like a charm. -
3. Re: Help me design a conversation scope using a4j:KeepAlive
hbmailinglist Mar 27, 2008 1:43 PM (in response to hbmailinglist)Just an update on this...
The a4j:keepAlive works as long as all page navigation is done through posts.
I retrieve the actual visit bean using the code snippet fabmars posted (THANKS!).
I'll continue to post my findings on this thread...