You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Parson (JIRA)" <ji...@apache.org> on 2013/01/14 11:42:12 UTC

[jira] [Commented] (WICKET-4914) Component#setDefaultModelObject() in beforeRender throws Exception: "Cannot modify component hierarchy after render phase has started"

    [ https://issues.apache.org/jira/browse/WICKET-4914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13552565#comment-13552565 ] 

Peter Parson commented on WICKET-4914:
--------------------------------------

Sorry for the late response :(

When trying to create a quick start, I realized that the problem is not as obvious as I thought before. I ran into this frequently, however do not remember where and could not reproduce this in a quick start :( Obviously there were some special circumstances involved that I have not been aware of.
Yikes, should have created a QS right away, sorry...

If you want to, you may close this one, and I'll create a new one (with quick start) when I run into it again

Sorry for the inconvenience....
                
> Component#setDefaultModelObject() in beforeRender throws Exception: "Cannot modify component hierarchy after render phase has started"
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4914
>                 URL: https://issues.apache.org/jira/browse/WICKET-4914
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.2.0
>            Reporter: Peter Parson
>            Assignee: Igor Vaynberg
>              Labels: component
>
> Internally, 
> setDefaultModelObject() 
> calls 
> modelChanging()
> calls
> checkHierarchyChange()
> which throws an exception when in render phase.
> I do not think that changing a model's object is a change in hierarchy. (This is why I filed this as "bug".)
> Otherwise  getDefaultModel().setObject() should throw an exception also.
> And why is setDefaultModelObject() behaving different from getDefaultModel().setObject() at all? (This I would actually call a "usability problem"... it looks like a convenience method, but does a lot of other things under the hood)
> As it is quite confusing, maybe setDefaultModelObject() should be renamed to reflect the difference in behavior?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira