[jira] [Updated] (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:all-tabpanel ] Martin Grigorov updated WICKET-5417: Attachment: WICKET-5417.patch Attaching a possible solution. I'm not 100% certain we want to do this though. If you know you want to replace the current component with another you can call super.onInitialize() after the replacement. [~svenmeier], [~ivaynberg] What do you think ? > 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)
[jira] [Updated] (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:all-tabpanel ] Ryan Dearing updated WICKET-5417: - Description: 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 } was: 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.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 > Attachments: 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)
[jira] [Updated] (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:all-tabpanel ] Ryan Dearing updated WICKET-5417: - Description: 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 } was: 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 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.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 > Attachments: 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)
[jira] [Updated] (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:all-tabpanel ] Ryan Dearing updated WICKET-5417: - Attachment: replacewithbug.tgz Quickstart to repro bug > 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 > Attachments: 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 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)