Event processing should be enabled when bindings are set with pss enabled
-------------------------------------------------------------------------

                 Key: MYFACES-2683
                 URL: https://issues.apache.org/jira/browse/MYFACES-2683
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.0
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


At the end of DefaultFaceletsStateManagementStrategy.restoreView we do this 
call:

view.visitTree(VisitContext.createVisitContext(context), new 
RestoreStateCallback());

This one propagates PostRestoreStateEvent, that triggers set binding property 
on all beans (see UIComponent.processEvent).

An possible use case in jsf 1.1 and jsf 1.2 is add additional components to the 
tree on that event. Long time ago, that was an implementation detail but now it 
was standarized. Right now with pss disabled everything works fine but with pss 
enabled that use case does not work.

The reason why this is not working is we use a listener attached to 
PostAddToViewEvent / PreRemoveFromViewEvent to keep track of programatically 
added / removed components. Since RestoreViewExecutor disable event processing 
on restore view, PostAddPreRemoveFromViewListener just don't receive the events 
and all added components are just skipped.

This does not happen with pss disabled because we don't rely there of some kind 
of Listener to keep track of changes on component tree, we just save the whole 
tree and that's it.

A similar problem we have on the same method (see vdl.buildView):

                // TODO: Why is necessary enable event processing?
                // ANS: On RestoreViewExecutor, setProcessingEvents is called 
first to false
                // and then to true when postback. Since we need listeners 
registered to PostAddToViewEvent
                // event to be handled, we should enable it again. We are 
waiting a response from EG about
                // the behavior of those listeners, because for partial state 
saving we need this listeners
                // be called from here and relocate components properly, but 
for now we have to let this code as is.
                try 
                {
                    context.setProcessingEvents (true);
                    vdl.buildView (context, view);

I think it is better to enable it in this case

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to