Yep. It looks simple and efficient. But it's quite a repetitive
task. As I already mentioned I am going to create a component. And a
data conversion should be its direct responsibility. The model wrapper
cannot be provided from outside. It would be conceptually wrong in
this case. I think this question is a bit wider then just a particular
case with choices to bits conversion. I am getting running into this
problem again and again. Wicket was created with a component driven
design in mind and for, wasn't it?
On Tue, Apr 8, 2008 at 10:29 PM, John Krasnay <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 08, 2008 at 08:16:18PM +0200, Vitaly Tsaplin wrote:
> > Thanks John,
> >
> > It was the idea that came to my mind first. The question is where I
> > can create such a wrapper? I need to have it compatible with
> > CompountPropertyModel... That's the sticking point.
>
> CompoundPropertyModel is just meant as a convenience. There's nothing
> wrong with using it for your other fields and giving an explicit model
> to your CheckBoxMultipleChoice...
>
> form = new Form("form" new CompoundPropertyModel(domainModel));
> add(form);
> form.add(new TextBox("textProperty")); // uses compound model
> form.add(new CheckBoxMultipleChoice("intProperty",
> new BitMapModel(new PropertyModel(domainModel, "intProperty")),
> new BitMapModel(new Model(-1)), // all bits set
> new ChoiceRenderer() { ... }));
>
>
>
> 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]