Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4914

Component#setDefaultModelObject() in beforeRender throws Exception: "Cannot modify component hierarchy after render phase has started"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 6.2.0
    • None
    • wicket

    Description

      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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            pparson Peter Parson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: