Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
I just noticed it :-(. Thanks very much. This is exactly what I am looking for but did not find it in the ebooks I bought. This will be one of my wicket bible pieces and probably I would keep complaining to get more messages from saints. Apologies in advance. >have you noticed that no one else i

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Igor Vaynberg
have you noticed that no one else is finding this particularly hard? class dataconverter implements imodel { final imodel model; public dataconverter(imodel model) { this.model=model; } public void detach() { model.detach(); } public Object getObject() { return convertToComponent(model.g

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
Mine is not working. I feel these "basic" data manipulation tasks are little to "heavy" in Wicket. Some built-in custom/helper classes could help a bit. I found I am writing many of these kind of custom class to do basic conversion and still have to worry if I am doing right, like the detach() me

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Johan Compagner
wondering if that really always works. looking at the current getConverter doc: /** * CheckBox will by default always just use the boolean converter because the implementation * expects that the string is can be converted to a boolean [EMAIL PROTECTED] Strings#isTrue(String)} *

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
I just tested and it worked. Thanks very much. Pardon me for being stubbon here. For a simple convertion like this, So much has to be created so it seems a little heavy weight. For this one, first a subclass of Checkbox (possibly creating multiple constructors) overide initmodel and separate cust

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Igor Vaynberg
what i have shown you will work independently of the fact that you are sure or not :) -igor On Tue, Mar 25, 2008 at 2:51 PM, <[EMAIL PROTECTED]> wrote: > I am not sure how this would solve my problem > I intend to only use > new CheckBox("checked") without adding any other arguments > since

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
I am not sure how this would solve my problem I intend to only use new CheckBox("checked") without adding any other arguments since I expect it to resolve the form's compoundpropertymodel whose object is entitybean with "checked" as column name. >or you can simply do: > >class YesNoCheckBox ex

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Igor Vaynberg
or you can simply do: class YesNoCheckBox extends CheckBox { protected IModel initModel() { return new CheckBoxYesNoModel(super.initModel()); } } -igor On Tue, Mar 25, 2008 at 2:29 PM, <[EMAIL PROTECTED]> wrote: > Use model decorator sometimes seems troublesome. > I need to use a for

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
Use model decorator sometimes seems troublesome. I need to use a form containing a lot of checkboxes and other types with compoundproperty model with a entity bean, say record. Most formcoponent ids are identical to their record property name, such as Textfield("firstName") and record also has "fir

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
Thanks. I'd prefer a custom checkbox class with converter. I just created a test class as below but not working. Appreciate any pointers. I did not find an example to follow. public class CheckBoxYN extends CheckBox{ public CheckBoxYN(String id){ super(id); } @Overrid

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Timo Rantalaiho
On Tue, 25 Mar 2008, Igor Vaynberg wrote: > you forgot the important detach() { room.detach(); } Oops, good catch. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Igor Vaynberg
you forgot the important detach() { room.detach(); } -igor On Tue, Mar 25, 2008 at 1:52 PM, Timo Rantalaiho <[EMAIL PROTECTED]> wrote: > > On Tue, 25 Mar 2008, [EMAIL PROTECTED] wrote: > > Is there built-in mechanism to auto convert the checkbox model value > > to be a character set Y/N or Ye

Re: CheckBox uses true/false but model is Y/N

2008-03-25 Thread Timo Rantalaiho
On Tue, 25 Mar 2008, [EMAIL PROTECTED] wrote: > Is there built-in mechanism to auto convert the checkbox model value > to be a character set Y/N  or Yes/No or any other pairs? > This is frequently used pattern. Probably you could set your own IConverter on the component corresponding the checkbox

CheckBox uses true/false but model is Y/N

2008-03-25 Thread dvd
Hello: Is there built-in mechanism to auto convert the checkbox model value to be a character set Y/N  or Yes/No or any other pairs? This is frequently used pattern. Thanks.