[
https://issues.apache.org/jira/browse/WICKET-336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Johan Compagner closed WICKET-336.
----------------------------------
Resolution: Fixed
test first if it is an inheritable model so then we don't unwrap
> Inheritable model cannot be a wrap model
> ----------------------------------------
>
> Key: WICKET-336
> URL: https://issues.apache.org/jira/browse/WICKET-336
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta5
> Environment: n.a.
> Reporter: Jan Vermeulen
> Assignee: Johan Compagner
> Fix For: 1.3.0-beta5
>
>
> In the code of Component:initModel(), when it comes accross an IWrapModel, it
> always gets its nested model, not considering if this model itself might be
> an IInheritableModel.
> for (Component current = getParent(); current != null; current =
> current.getParent())
> {
> // Get model
> IModel model = current.getModel();
> if (model instanceof IWrapModel)
> {
> model = ((IWrapModel)model).getNestedModel();
> }
> if (model instanceof IInheritableModel)
> {
> ....
> }
> }
> Would it be correct do make the following correction ?
> if (model instanceof IWrapModel && !(model instanceof
> IInheritableModel))
> {
> model = ((IWrapModel)model).getNestedModel();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.