You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sebastien Briquet (JIRA)" <ji...@apache.org> on 2014/12/19 15:33:13 UTC

[jira] [Created] (WICKET-5792) initModel and 'compound' components only

Sebastien Briquet created WICKET-5792:
-----------------------------------------

             Summary: initModel and 'compound' components only
                 Key: WICKET-5792
                 URL: https://issues.apache.org/jira/browse/WICKET-5792
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 7.0.0-M4, 6.18.0
            Reporter: Sebastien Briquet
            Priority: Minor


I often use {{#initModel}} in my pages because I find it very convenient in many usecase...

Actually there is an issue in a certain scenario: let's say #initModel is supposed to return a {{CompoundPropertyModel}}. So I am free to explicitly *not* provide the model to the component that consume this model, a label for instance. But, If the page only contains those 'compound' components, #initModel is never called so the model is never set.

A workaround is to set the model manually:
{{this.setModel(this.initModel());}}

(From Sven, in the users@)
{quote}
this topic was discussed before:
When searching parental components for a IComponentInheritedModel, #initModel() is skipped to prevent unnecessary creation of intermediate models. See the comment on line 3788 ff:

https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/Component.java#L3788
{quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)