No, not an IComponentInheritedModel but in IComponentAssignedModel. ResourceModel implements this interface for example.
If I have e.g. a subclass of Label and override the initModel(), I return a new ResourceModel(...) there. But then the resource model's wrapOnAssignment() is not called. But if I do a setModel(new ResourceModel(...)) (e.g. in the constructor) then the wrapOnAssignment() is called. So I think that it was simply forgotten to wrap the result of initModel() (see wrap() in Component class). Bart. > -----Oorspronkelijk bericht----- > Van: Johan Compagner [mailto:[EMAIL PROTECTED] > Verzonden: woensdag 12 december 2007 11:20 > Aan: [email protected] > Onderwerp: Re: Component.initModel() doesn't handle > IComponentAssignedModel correctly? > > Hmm so you have a IComponentInheritedModel that returns with the > getWrapModel call > a IWrapModel that is also a IComponentAssignedModel?? > > johan > > > > On Dec 12, 2007 9:25 AM, Bart Molenkamp > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I think the Component.initModel() isn't working correctly. > > IComponentAssignedModel implementations don't get a wrapped > > model. This e.g. breaks the ResourceModel. > > > > I think that the line around 1490 should change from > > > > model = initModel(); > > > > to: > > > > model = wrap(initModel()); > > > > Is this correct? > > > > Thanks, > > Bart. > > >
