dev@javaserverfaces.java.net

Re: Review:revert to old listener restore mechanism

From: Jacob Hookom <jacob_at_hookom.net>
Date: Tue, 17 May 2005 16:46:21 -0500

Doesn't the documented code in UIComponentBase (line 1310) mention
correcting this issue?

Object gets new'ed, listeners registered, restore state then copies over
the internal list.

-- Jacob

Jayashri Visvanathan wrote:

> Hi Adam,
> In JSF 1.1 world, we didn't support multiple Method Binding
> ActionListeners. So whenever a method binding action listener is added
> from a constructor, it would be overridden by the saved listener if
> any during restoreState. But now all listener registrations go through
> addActionListener and we support methodExpression/methodBinding
> multiple action listeners. This causes any listeners added via
> constructor to accumulate. (I ran into this problem with our Graph
> Component demo which registers a methodBinding ActionListener via its
> constructor. )
>
> Thanks
> -Jayashri
>
>
>
> Adam Winer wrote:
>
>> Ed Burns wrote:
>>
>>>>>>>> On Tue, 17 May 2005 10:53:49 -0700, Jayashri Visvanathan
>>>>>>>> <Jayashri.Visvanathan_at_Sun.COM> said:
>>>>>>>
>>>>>>>
>>>
>>>
>>> JV> M src/javax/faces/component/UIComponentBase.java
>>> JV> If we override the listeners list with the list persisted by the
>>> JV> state saving mechanism, transient listeners will be lost.
>>> JV> So revert back to the old way of restoring listeners.
>>>
>>> This is fine. Make sure to add a readme that states that adding a
>>> listener in the ctor is a bad idea.
>>
>>
>>
>> I don't think we can say "bad idea"; either the spec
>> says it's completely illegal, or we need to support it.
>> What's the issue with adding a listener in the constructor
>> of a subclass of UIComponentBase?
>>
>> -- Adam
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>
>


-- 
Jacob Hookom - Minneapolis
--------------------------
http://hookom.blogspot.com