Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-984
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ed Burns
Reporter: aschwart
Votes: 4
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

Component context management

Created: 21/Apr/11 12:18 PM   Updated: 16/Dec/11 09:01 PM   Resolved: 16/Dec/11 08:33 PM
Component/s: Components/Renderers
Affects Version/s: 2.2 Sprint 8
Fix Version/s: 2.2 Sprint 9

Time Tracking:
Not Specified

File Attachments: 1. Text File changebundle.txt (13 kB) 16/Dec/11 08:29 PM - Ed Burns

Issue Links:
Dependency
 

Status Whiteboard:

size_large importance_large

Tags:
Participants: aschwart and Ed Burns


 Description  « Hide

CA fairly common pattern in JSF is for container components to temporarily set up context that is available while processing children - eg. UIData sets up the "var" value before executing child lifecycle methods. In Trinidad and ADF Faces we have a variety of components that establish similar context.

An issue with this is that there is no way to unwind/suspend this context in cases where it is necessary to interrupt processing in order to start over in a new context - eg. when invokeOnComponent() or visitTree() is called.

Trinidad has solved this problem via its ComponentContextManager API. See:

http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/context/ComponentContextManager.java?view=markup

This provides a common mechanism that components can use for pushing/popping/suspending their context and allows for new invokeOnComponent()/visitTree() calls to be initiated in a clean environment.

In addition, Trinidad's UIXComponent provides a number of hooks to assist components with their context setup/teardown.

One problem with Trinidad's solution is that it only applies to Trinidad-based components. Ideally this problem should be solved by the JSF specification in a generic manner so that all components can participate.



Ed Burns added a comment - 02/Nov/11 01:19 AM

Carry forward to 2.2 Sprint 9.


Ed Burns added a comment - 16/Dec/11 06:34 PM

Andy, can you please verify my understanding? Have I got this right:

You are not suggesting that we implement this API and, at the same time, modify
invokeOnComponent() and visitTree() to automatically perform the spend/resume using
the API?

In other words:

This proposal seeks to provide an API that components can use themselves when they need
to be able to temporarily suspend their processing in order to correctly perform
a invokeOnComponent() or visitTree() operation. There will be no occurrences of using
this API in the standard components.

Is that correct?


Ed Burns added a comment - 16/Dec/11 08:33 PM

First draft of API committed to trunk.

Adding jsf-api/src/main/java/javax/faces/component/visit/ComponentModification.java
Adding jsf-api/src/main/java/javax/faces/component/visit/ComponentModificationManager.java
Sending jsf-api/src/main/java/javax/faces/context/FacesContext.java
Sending jsf-api/src/main/java/javax/faces/context/FacesContextWrapper.java
Sending jsf-ri/src/main/java/com/sun/faces/context/FacesContextImpl.java
Transmitting file data .....
Committed revision 9521.