You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Steven Rudolf <St...@web.de> on 2011/08/29 11:44:29 UTC

CODI ViewAccessScope use-case in use-case approach

Hello,

I'm using CODI (v 1.0.1) and I'm loving the ViewAccessScope becaue it is really easy to program my use cases if I know, that the beans will clean up if I don't access them anymore after redirecting to the next view. So mainly all my beans are ViewAccessScope and the transfer of values between screens works with viewParams.

Now I have an "use case in use case" approach, where I have to link from one use case (A) to another screen (B) only for searching an entity and then link back to the calling use case (A). I realized it with a simple redirect and I access the A-Bean from the B-view with a ping-method so that the A-Bean will not be destroyed. But if I link back to the A-view then a new A-Bean will be created because the A-view doesn't know the old A-Bean anymore.

I think that the assignement of bean to view is destroyed after redirecting to B-view so that the render of A-view will create a new A-Bean. After looking to the CODI sources I think that will be done in org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ViewAccessConversationExpirationEvaluator.

How can I program my use-case? Is there a ViewAccess-ExceptOneSpecialLink-Scope poossible? Maybe I can write a PhaseListener where I can plant the old A-Bean to the new rendered A-view?

Respectfully,
Steven Rudolf

___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Re: CODI ViewAccessScope use-case in use-case approach

Posted by Gerhard Petracek <ge...@gmail.com>.
hi steven,

first of all: welcome @ myfaces!

please provide more information on how you touch the bean of your first
use-case (A).

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/8/29 Steven Rudolf <St...@web.de>

> Hello,
>
> I'm using CODI (v 1.0.1) and I'm loving the ViewAccessScope becaue it is
> really easy to program my use cases if I know, that the beans will clean up
> if I don't access them anymore after redirecting to the next view. So mainly
> all my beans are ViewAccessScope and the transfer of values between screens
> works with viewParams.
>
> Now I have an "use case in use case" approach, where I have to link from
> one use case (A) to another screen (B) only for searching an entity and then
> link back to the calling use case (A). I realized it with a simple redirect
> and I access the A-Bean from the B-view with a ping-method so that the
> A-Bean will not be destroyed. But if I link back to the A-view then a new
> A-Bean will be created because the A-view doesn't know the old A-Bean
> anymore.
>
> I think that the assignement of bean to view is destroyed after redirecting
> to B-view so that the render of A-view will create a new A-Bean. After
> looking to the CODI sources I think that will be done in
> org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.ViewAccessConversationExpirationEvaluator.
>
> How can I program my use-case? Is there a
> ViewAccess-ExceptOneSpecialLink-Scope poossible? Maybe I can write a
> PhaseListener where I can plant the old A-Bean to the new rendered A-view?
>
> Respectfully,
> Steven Rudolf
>
> ___________________________________________________________
> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>