Hi

2010/5/11 Andy Schwartz <andy.schwartz@oracle.com>
Hey Leonardo -


To restore the "component" reference required, both implementations call UIComponent.getCurrentComponent() and both call processEvent but for the parent!.

Interesting...  I recently spent some time reading through your earlier "PostAddToViewEvent publishing conditions" thread and as a result playing around with PostAddToViewEvents.   I noticed that if I implement a custom component with a PostAddToViewEvent listener, eg:

@ListenerFor(systemEventClass=PostAddToViewEvent.class)
@FacesComponent("foo.PostAddTester")
public class PostAddTester extends UIComponentBase implements ComponentSystemEventListener {


During the initial request, the event is delivered to my custom component.  However, after a postback, the event is instead delivered to the custom component's parent.

I was hoping to find some time to try to track this down and log it (didn't realize it was a spec issue - figured implementation bug), but you beat me to it!

I agree with you that the current component should be in context when saveState()/restoreState() are called.  It is interesting that processSaveState()/processRestoreState() behave differently from the other process* methods.  Makes me wonder whether this was done intentionally.  Anyone know?

Do you want to log a spec issue?  If so, let me know the issue # - I can also upload my little test case that demonstrates the problem.


Ok, here is the link:

http://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=792

Leonardo
 
Andy