You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Caleb Land (JIRA)" <ji...@apache.org> on 2006/10/17 02:49:35 UTC

[jira] Created: (WICKET-7) IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX

IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX
-------------------------------------------------------------------------------------------------

                 Key: WICKET-7
                 URL: http://issues.apache.org/jira/browse/WICKET-7
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 2.0
         Environment: Wicket 2.0
            Reporter: Caleb Land


The IBehavior#rendered() method is called twice when a component that has that behavior is rendered via AJAX.  When rendering the component though the normal process (not ajax) it is only called once.

Here are the two places it's getting called:

The AjaxRequestTarget#respondComponent() method calls component.renderComponent() which tells the behaviors that the component was rendered (line 464 of AjaxRequestTarget.java ).

The AjaxRequestTarget#respondHeaderContribution() method goes calls each component's renderedBehaviors() method which ends up calling IBehavior#rendered() (lines 513 and 524 of AjaxRequestTarget.java).

The result of this is that Firefox, Safari, and Opera (I don't know about IE) end up executing any javascript that's rendered through a behavior twice.

The example I tested was adding an AutoCompleteTextField to a page through ajax.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WICKET-7) IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464418 ] 

Eelco Hillenius commented on WICKET-7:
--------------------------------------

Can't reproduce this for 2.0, but onComponentRendered is called twice in 1.3

> IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-7
>                 URL: https://issues.apache.org/jira/browse/WICKET-7
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0
>         Environment: Wicket 2.0
>            Reporter: Caleb Land
>
> The IBehavior#rendered() method is called twice when a component that has that behavior is rendered via AJAX.  When rendering the component though the normal process (not ajax) it is only called once.
> Here are the two places it's getting called:
> The AjaxRequestTarget#respondComponent() method calls component.renderComponent() which tells the behaviors that the component was rendered (line 464 of AjaxRequestTarget.java ).
> The AjaxRequestTarget#respondHeaderContribution() method goes calls each component's renderedBehaviors() method which ends up calling IBehavior#rendered() (lines 513 and 524 of AjaxRequestTarget.java).
> The result of this is that Firefox, Safari, and Opera (I don't know about IE) end up executing any javascript that's rendered through a behavior twice.
> The example I tested was adding an AutoCompleteTextField to a page through ajax.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (WICKET-7) IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius resolved WICKET-7.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
                   1.3

> IBehavior#rendered() is called twice when a component that has that behavior is rendered via AJAX
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-7
>                 URL: https://issues.apache.org/jira/browse/WICKET-7
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0
>         Environment: Wicket 2.0
>            Reporter: Caleb Land
>             Fix For: 1.3, 2.0
>
>
> The IBehavior#rendered() method is called twice when a component that has that behavior is rendered via AJAX.  When rendering the component though the normal process (not ajax) it is only called once.
> Here are the two places it's getting called:
> The AjaxRequestTarget#respondComponent() method calls component.renderComponent() which tells the behaviors that the component was rendered (line 464 of AjaxRequestTarget.java ).
> The AjaxRequestTarget#respondHeaderContribution() method goes calls each component's renderedBehaviors() method which ends up calling IBehavior#rendered() (lines 513 and 524 of AjaxRequestTarget.java).
> The result of this is that Firefox, Safari, and Opera (I don't know about IE) end up executing any javascript that's rendered through a behavior twice.
> The example I tested was adding an AutoCompleteTextField to a page through ajax.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira