You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2013/11/15 16:53:21 UTC
[jira] [Commented] (WICKET-5417) this.replaceWith is broken when
called from onInitialize
[ https://issues.apache.org/jira/browse/WICKET-5417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13823752#comment-13823752 ]
Igor Vaynberg commented on WICKET-5417:
---------------------------------------
whats the usecase for component replacing itself during oninitialize()? it doesnt seem valid to me...
> this.replaceWith is broken when called from onInitialize
> --------------------------------------------------------
>
> Key: WICKET-5417
> URL: https://issues.apache.org/jira/browse/WICKET-5417
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.12.0
> Reporter: Ryan Dearing
> Assignee: Martin Grigorov
> Attachments: WICKET-5417.patch, replacewithbug.tgz
>
>
> When calling this.replaceWith within the onInitialize method, wicket throws an exception:
> "Last cause: org.apache.wicket.Component has not been properly initialized. Something in the hierarchy of com.mycompany.PanelA has not called super.onInitialize() in the override of onInitialize() method"
>
> This happens because detach is called on the panel being replaced which clears Component.request flags (sets to 0) which causes the exception on line 864 of Component.java:
> if (!getRequestFlag(RFLAG_INITIALIZE_SUPER_CALL_VERIFIED)) {
> // throws here
> }
--
This message was sent by Atlassian JIRA
(v6.1#6144)