Couldn't it be solved with a delegate model? It wouldn't be 100%
transparent, because the one who changes the underlying model would
need to know that the container's model is a delegating model, but
works perfectly.

Well, but if you guys are so eager to break things... what about this:
make getDefaultModel() never return the assigned model directly, but a
wrapper, that delegates to the real one (assigned by
setDefaultModel()). That way, any component that calls
getParent().getDefaultModel() will automatically get the new model.

All code out there that relies on 'if (getDefaultModel() instanceof
XXX)' will break (since it will return the wrapper), but this edge
case will work.



On Thu, Sep 27, 2012 at 7:18 PM, Jeremy Thomerson
<jer...@wickettraining.com> wrote:
> On Thu, Sep 27, 2012 at 3:33 PM, tetsuo <ronald.tet...@gmail.com> wrote:
>
>> What about calling APanel.setDefaultModelObject(B.getObject()) instead
>> of APanel.setDefaultModel(B)?
>>
>
> That's to replace an object inside a model.  There are very valid usecases
> for actually replacing a model.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to