populate model and checkboxes

Would it be possible to add a feature to populateModel()? If you have a property of type boolean and your using checkboxes it only populates them if they are present (checked). If they are not the model is not populated with a 0/false so the value never changes. I know I can easily do this but it would just be nice if somehow populate handled this. Maybe it does and I am missing something

rc.device = populateModel( model=vproService.get(rc.id),exclude=“id” );
// checkboxes
rc.device.setActive(event.getValue(“active”,false));

Seconded!

How would populateModel() know whether or not it is a checkbox?

The appropriate solution is to param your checkbox fields in the RC before passing off to any sort of populate method. This is just the nature of checkboxes.

// pseudo code
event.paramValue(“mycheckbox”,false);
rc.foo = populateModel(bla bla bla bla);

pseudo code

if( type == boolean && !structKeyExists(rc,“field_name”) ) {
runSetter(“field_name”,false);
}

I understand though … I don’t know why but

event.paramValue( ) just seems odd to me, ill get over it ;D