[
https://issues.apache.org/jira/browse/TRINIDAD-2402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott O'Bryan updated TRINIDAD-2402:
------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.0-core
Assignee: Jeanne Waldman
Status: Resolved (was: Patch Available)
> mechanism to setup a new component binding context
> --------------------------------------------------
>
> Key: TRINIDAD-2402
> URL: https://issues.apache.org/jira/browse/TRINIDAD-2402
> Project: MyFaces Trinidad
> Issue Type: Improvement
> Affects Versions: 2.0.1-core
> Reporter: Pavitra Subramaniam
> Assignee: Jeanne Waldman
> Fix For: 2.1.0-core
>
> Attachments: trinidad-2402.patch
>
>
> There are usecases where a custom tag that provides the ability to load
> dynamic layouts (or page fragments) based on app flow, requiring that new
> components be re-created when the tag is executed and a new layout different
> from the current one needs to be loaded.
> Merely deleting the component sub-trees in the tag handler does not entirely
> address the issue because when the tag is re-executed today, if a binding EL
> is set on the component, then the component instance held by the backing bean
> instance (typically a reuqest scoped bean) get reused instead of a new
> component being created.
> In order to force create the component instance, this new API will allow tag
> handlers to notify the framework by starting a new "component binding
> context". Between a pair of push and pop calls, component bindings will be
> cleared allowing for new component instances to be created and pushed to the
> backing bean.
> /**
> * Starts a new component binding context. Typically called from tag
> handlers when component
> * bindings in its subtree needs to be cleared, forcing the creation of new
> components.
> *
> * @param context FacesContext instance
> * @see RequestContext#popComponentBindingContext
> * @see RequestContext#isInComponentBindingContext
> */
> public static void pushComponentBindingContext(FacesContext context)
> {
> }
> /**
> * Pops out of the last pushed component binding context. Component binding
> instances will not be
> * cleared after popping out the outermost context.
> *
> * @param context FacesContext instance
> * @see RequestContext#pushComponentBindingContext
> * @see RequestContext#isInComponentBindingContext
> */
> public static void popComponentBindingContext(FacesContext context)
> {
> }
> /**
> * Returns true if we are currently within a component binding context.
> *
> * @see RequestContext#pushComponentBindingContext
> * @see RequestContext#popComponentBindingContext
> */
> public static boolean isInComponentBindingContext(FacesContext context)
> {
> }
--
This message was sent by Atlassian JIRA
(v6.1#6144)