You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2014/04/04 08:28:16 UTC

[jira] [Resolved] (WICKET-5546) Adding behavior in component instantiation listener causes Page.onInitialize() being called even if constructor throws an exception

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

Sven Meier resolved WICKET-5546.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 6.15.0
                   7.0.0

Page's #init() is called first now.

> Adding behavior in component instantiation listener causes Page.onInitialize() being called even if constructor throws an exception
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5546
>                 URL: https://issues.apache.org/jira/browse/WICKET-5546
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.13.0, 6.14.0
>            Reporter: Robin Shine
>            Assignee: Sven Meier
>            Priority: Minor
>             Fix For: 7.0.0, 6.15.0
>
>         Attachments: WICKET-5546.patch, WICKET-5546.zip
>
>
> Page.onInitialize() will be called even if constructor throws an exception
> in case below code is added in wicket WebApplication.init():
> getComponentInstantiationListeners().add(new IComponentInstantiationListener() {
>               @Override
>               public void onInstantiation(Component component) {
>                   component.add(new Behavior() {
>                   });
>               }
>              
>           });
> It seems that the instantiation listener adds the behavior to the page at very start of the page constructor, and then the page is marked as dirty to cause onInitialize() being called afterwards.



--
This message was sent by Atlassian JIRA
(v6.2#6252)