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:34:14 UTC

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

     [ https://issues.apache.org/jira/browse/WICKET-5792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebastien Briquet updated WICKET-5792:
--------------------------------------
    Attachment: WICKET-5792.zip

Attached Quickstart

> 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: 6.18.0, 7.0.0-M4
>            Reporter: Sebastien Briquet
>            Priority: Minor
>         Attachments: WICKET-5792.zip
>
>
> 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)