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. The converter can then be reused
as needed.
I've typically (if not always) used checkboxes with custom models
directly toggling things in domain objects, e.g.
class RoomReservedModel extends Model {
private IModel room;
public RoomReservedModel(IModel room) {
this.room = room;
}
@Override
public void setObject(Object object) {
room().setReserved((Boolean) object);
}
@Override
public Object getObject() {
return room().isReserved();
}
private Room room() {
return (Room) room.getObject();
}
}
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]