Hi,
i have trouble generating a form that should pe prefilled with data.
All fields are fine but the CheckboxSetField.
I have a class "Request" (extended from DataObject ) that has a many_many relation to the class "Artistcategory"
Now i want to show my "RequestForm" and populate the Data coming from a DataObject.
public function RequestForm()
{
Validator::set_javascript_validation_handler('none');
$form = new RequestForm($this, 'RequestForm');
if( $this->_Request instanceof Request ) {
$form->loadDataFrom ( $this->_Request);
}
return $form;
}
All fields are populated with the correct data of the dataobject.
But not the CheckboxSetField. It's always empty (no Checkbox is ticked).
Any ideas ?
Class Request:
class Request extends DataObject {
public static $db = array(
..........
);
public static $many_many = array(
'Artistcategories' => 'Artistcategory'
);
Class Artistcategory:
class Artistcategory extends DataObject {
public static $db = array(
......
);
public static $many_many = array(
.......
);
public static $belongs_many_many = array(
'Requests' => 'Request',
);
]