Re: Use Byte vor CheckBox instead of Boolean

2011-01-25 Thread Jeremy Thomerson
On Tue, Jan 25, 2011 at 7:18 AM, MattyDE  wrote:

> its not the
> wicket-way right?
>

It's *a* wicket way.  I'd say it's better than Martin's suggestion of
copy-and-paste code.  But, at the end of the day, it's up to your style
preference.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Use Byte vor CheckBox instead of Boolean

2011-01-25 Thread MattyDE

Thanks for the fast reply. I thought about this also, but ... its not the
wicket-way right? 


Martin Grigorov-4 wrote:
> 
> On Tue, Jan 25, 2011 at 2:02 PM, MattyDE  wrote:
> 
>>
>> Everyone know what i want Byte 0 = False  Byte 1 = True.
>>
>> But unfornately "getConverter" is final in CheckBox so i cant place my
>> own
>> converter there.
>>
>> Any ideas?
>>
> Copy CheckBox to MyCheckBox and hack it however you want.
> 
>>
>> Thanks :)
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Use-Byte-vor-CheckBox-instead-of-Boolean-tp3236065p3236065.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Byte-for-CheckBox-instead-of-Boolean-tp3236065p3236118.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Use Byte vor CheckBox instead of Boolean

2011-01-25 Thread Ernesto Reinaldo Barreiro
Can´t you just use a nested model like

public class ByteBooleanModel implements IModel {

private static final long serialVersionUID = 1L;

private IModel model;
public ByteBooleanModel(IModel model) {
this.model = model;
}

/* (non-Javadoc)
 * @see org.apache.wicket.model.IModel#getObject()
 */
@Override
public Boolean getObject() {
if(model.getObject()== null)
return null;
if(model.getObject().equals(1))
return Boolean.TRUE;
return Boolean.FALSE;
}

/* (non-Javadoc)
 * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
 */
@Override
public void setObject(Boolean object) {
if(object == null)
this.model.setObject(null);
if(object)
this.model.setObject((byte)1);
else
this.model.setObject((byte)0);

}

/* (non-Javadoc)
 * @see org.apache.wicket.model.IDetachable#detach()
 */
@Override
public void detach() {
this.model.detach();
}
}

to allow value be stored as a byte?

Ernesto

On Tue, Jan 25, 2011 at 2:02 PM, MattyDE  wrote:
>
> Everyone know what i want Byte 0 = False  Byte 1 = True.
>
> But unfornately "getConverter" is final in CheckBox so i cant place my own
> converter there.
>
> Any ideas?
>
> Thanks :)
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Use-Byte-vor-CheckBox-instead-of-Boolean-tp3236065p3236065.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Use Byte vor CheckBox instead of Boolean

2011-01-25 Thread Martin Grigorov
On Tue, Jan 25, 2011 at 2:02 PM, MattyDE  wrote:

>
> Everyone know what i want Byte 0 = False  Byte 1 = True.
>
> But unfornately "getConverter" is final in CheckBox so i cant place my own
> converter there.
>
> Any ideas?
>
Copy CheckBox to MyCheckBox and hack it however you want.

>
> Thanks :)
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Use-Byte-vor-CheckBox-instead-of-Boolean-tp3236065p3236065.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Use Byte vor CheckBox instead of Boolean

2011-01-25 Thread MattyDE

Everyone know what i want Byte 0 = False  Byte 1 = True.

But unfornately "getConverter" is final in CheckBox so i cant place my own
converter there.

Any ideas?

Thanks :)
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Byte-vor-CheckBox-instead-of-Boolean-tp3236065p3236065.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org