The method getModel will always return a wrapper and that fact breaks an encapsulation. So we can say that any wrapping can be done only from outside which is not good. A conversion is an essential part of an internal component's functionality and it's normally shoudn't be exposed. I am not so strict as you can think but since wicket people are struggling for every final keyword in the API I am trying to be conceptual as well :)
On Wed, Apr 9, 2008 at 5:30 PM, John Krasnay <[EMAIL PROTECTED]> wrote: > On Wed, Apr 09, 2008 at 05:09:03PM +0200, Vitaly Tsaplin wrote: > > What is going to happen if I call getModel on such a component? The > > model should be properly unwrapped I suspect. It's a logical behavior. > > Is it possible to achieve? > > If you extend CheckBoxMultipleChoice, getModel() must return a > Collection. That's the contract that CheckBoxMultipleChoice offers, as > you will see when Wicket becomes generified in 1.4. If you create a > panel, then your model can be whatever you want, as long as you provide > an appropriate model to the CheckBoxMultipleChoice when you create it. > > Wicket does no "unwrapping" of models; the fact that a model delegates a > portion of its operation to another model is purely an implementation > detail of that model. > > > > jk > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
