I always get the blame! :) Seriously, I don't remember such a thing
and in fact hardly have been involved in the models design discussions
for 2.0 other than having to fix/ complain on wicket-contrib-menu
until I grew so tired of it that I decided to not support the project
any longer. So, whatever works for you Johan and Igor :)
Eelco
On 2/28/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
ha! you and eelco made me remove that feature! thats how it was in the
beginning - but no...who is going to need a wrapper that is itself
inheritable. pfft.
-igor
On 2/28/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
>
> please make a jira issue for this
>
> On 2/28/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote:
> >
> >
> > I have the following case:
> >
> > I have an IAssignmentAwareModel: on assignment, the model creates a
> > wrapper
> > that is appropriate for a component. If the user assigns this model to a
> > form, the form ends up with an IWrapModel that is itself an
> > IInheritableModel: on inheritance, it creates a wrapper for a specific
> > formComponent.
> >
> > So the idea is that, when the user does not specify a model for a
> > formComponent, it ends up with a wrapper provided by the form's model.
> But
> > this does not work, because the form's model is at the same time an
> > IWrapModel. 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();
> > }
> >
> > Jan.
> > --
> > View this message in context:
> >
>
http://www.nabble.com/Inheritable-model-cannot-be-a-wrap-model-tf3308687.html#a9203428
> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >
> >
>