Thanks Bernhard,
from a user's view, what's the impact to JSF applications of this issue? And
in what cases this problem can be reproduced? Is there anyway that I can
mitigate it if brings about any problem before this issue is fixed?
Fan
Bernhard Huemer-2 wrote:
>
> Hello,
>
> I've encountered the same problem recently and I've also figured out the
> reason. It's because the method setProperties() is called twice. Usually
> you wouldn't notice this behaviour as most properties just will be
> overridden but that's not the case for a ValueChangeListener (or an
> ActionListener). For a better understanding of this issue, I'll describe
> the call hierachy (somewhat simplified):
>
> ///
> //
> myfaces/core/branches/1_2_1/api/javax/faces/webapp/UIComponentClassicTagBase.java
>
> protected UIComponent findComponent(FacesContext context)
> {
> // ...
> // around line 1097
>
> _componentInstance = findComponent(parent,id);
> if (_componentInstance == null)
> {
> _componentInstance = createComponent(context, id);
> _created = true;
> setProperties(_componentInstance); // << here is the
> "first" call
> // ....
>
> \\\
>
> ///
> //
> myfaces/core/branches/1_2_1/api/javax/faces/webapp/UIComponentELTag.java
>
> protected UIComponent createComponent(FacesContext context, String newId)
> {
> // ...
> // around line 98
>
> component.setId(newId);
> setProperties(component); // << her is the "second" call (it's
> actually the first, but it's the one I would omit)
>
> return component;
> }
>
> \\\
>
> I'll create a JIRA issue (including the appropriate patch) in a few
> hours, or maybe anyone else might be taking a look in the meantime.
>
> regards,
> Bernhard
>
> Fan Shao wrote:
>> Hi,
>>
>> When trying to trace down the problem I posted a few days ago
>> (http://www.nabble.com/Button-must-be-clicked-once-before-it-could-actually-do-something-tf4297733.html#a12234990)
>> I found some of the events are fired twice, where they are supposed to be
>> fired only once.
>>
>> The screen contains a datatable, and a dropdown box. When the user
>> selects a
>> value of the dropdown box, the form is submitted using
>> this.form.submit(),
>> and the datatable is reloaded according to user's selection. Everytime
>> the
>> datatable is reloaded its associated handler is called twice.
>>
>> Anyone has any idea about this?
>>
>> Many thanks!
>>
>> Fan
>>
>
>
>
--
View this message in context:
http://www.nabble.com/Events-are-fired-twice-for-unknown-reasons-tf4352767.html#a12462673
Sent from the MyFaces - Users mailing list archive at Nabble.com.