[jsr-314-open-mirror] [jsr-314-open] Cannot call UIComponent.getCurrentComponent() from UIComponent.restoreState() or UIComponent.saveState()

Leonardo Uribe lu4242 at gmail.com
Tue May 11 12:15:41 EDT 2010


Hi

2010/5/11 Andy Schwartz <andy.schwartz at 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100511/b7b8aa5b/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list