I think that the PAGE scope means the context lives until the NEXT render response phase. So as long that occurs it will be cleaned up then. What happens otherwise I don't know.
So kind of an EVENT +1 request scope for a given view? I dislike not understanding this thing. I'll have to prototype it, but don't have time today. Either way it'll only tell me how it does work, not how it should work.
Anyone in the know care to comment? School me if you will.
Event Scope Example:
In Request x the user visits the page which references an outjected DataModel initialized by a Factory method. The user then clicks on a link (e.g. a detail view for a particular entity) at their leisure. In Request x + 1the state is lost and so information (e.g. entity id) must be propogated using a request parameter to allow the detail to be displayed
Page Scope example:
In Request x the user visits the page which references an outjected DataModel initialized by a Factory method. The user then clicks on a link (e.g. a detail view for a particular entity) at their leisure. In Request x + 1the state (of the datamodel at least) is still present in the page scope. The row clicked can then be retrieved using e.g. DataModelSelection
This is why in the manual it says PAGE scope allows easy implementation of clickable lists. Though LIEs can occur if you work directly with the PAGE scope object in a further conversation.
Can I use the PAGE Scope SFSB in multiple same requests? e.g. DataModel category, DataModelSelection subcategory, deep looping. At this situation, the PAGE Scope SFSB is similar to Conversation Scope SFSB, is it correct? Thank you in advance.
I don't really follow you sorry. You could describe PAGE scope as a mini-conversation that spans a single Request-Response-Request cycle. If you are asking whether the PAGE scope can be used to achieve a multi-level Master-Detail view architecture, then yes I suppose it could, but a long running conversation would probably be more useful.
For example I use PAGE scope to implement a clickable list where the click takes the user to another view and there is no need to retain any state (other than the item clicked) from the list screen.
Thanks Pete. This clears things up for me.
Thank you for your reply. I have a categories list in jsf page. @DataModel List categoryList, @DataModelSelection Category selectedCategory. When click one category, the page will list subcategory list, then click a subcategory, it will display sub-subcategory list .... Currently, I use SESSION Scope SFSB. I have a problem with the browser BACK. That is, when I click a category on supcategory list, the page displays its subcategory list. However, when I click browser BACK, the page was back to supcategory list. When I try to click another category on the supcategory list, the page will not display the subcategory list which I just clicked, but it went to the subcategory list which I previously clicked, I don't what is wrong with my SESSION Scope SFSB. Thank you for your help in advance.
PAGE scope objects are essentially never cleaned up!
Why? because they live on the client side! The user can at any time backbutton to the page and click on one of its buttons.
So PAGE scope has an indeterminate lifetime (but still a welldefinined extent).
(Thats why you can't put SFSBs in the PAGE context - they would never be cleaned up.)
Thank you very much, Gavin and Petemuir. I got more clear.