You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org> on 2007/09/28 09:28:50 UTC

[jira] Updated: (MYFACES-1712) FacesListeners get added to components twice causing event to be raised twice.

     [ https://issues.apache.org/jira/browse/MYFACES-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Marinschek updated MYFACES-1712:
---------------------------------------

    Status: Patch Available  (was: Open)

> FacesListeners get added to components twice causing event to be raised twice.
> ------------------------------------------------------------------------------
>
>                 Key: MYFACES-1712
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1712
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions:  1.2.0
>         Environment: Windows XP, Tomcat 6.0, jdk6, MyFaces 1.2.0, Tomahawk 1.1.5
>            Reporter: Andrew Redman
>
> On components that have an actionListener set or valueChangeListener, these listeners are added to the component instance twice. At runtime this causes the method to be called with the event twice. For example I have the following component
> <h:selectOneMenu id="Applications" onchange="submit()" valueChangeListener="#{EditPage.processApplicationChange}">
> my processApplicationChange method is invoke twice.
> I have tracked this down the UIComponentELTag and UIComponentClassicTagBase classes. The UIComponentClassicTagBase calls createComponent in the findComponent method and then calls setProperties. However the createComponent method that is implemented in UIComponentELTag also calls setProperties. The setProperties routine is what adds any listeners to a collection. Therefore they get added twice. By removing the setProperties in UIComponentELTag createComponent and leaving it up to the findComponent method fixes the issue. I'm not sure however if this will have other implications although as yet I have found no issues.

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