I am trying to add a dropdown populated by another dataobject (Company) to the MemberTableList (Security Tab)
The DataObjectDecorator:
class Customer extends DataObjectDecorator {
static $summary_fields = array(
'CompanyID' => 'Company'
);
function extraDBFields() {
return array(
'has_one' => array(
'Company' => 'Company'
)
);
}
public function updateCMSFields(FieldSet &$fields) {
$companies = DataObject::get("Company")->toDropdownMap('ID', 'CompanyName');
$fields->push(new DropdownField("CompanyID", "Company", $companies));
}
public function updateSummaryFields(&$fields)
{
$companies = DataObject::get("Company")->toDropdownMap('ID', 'CompanyName');
$fields->push(new DropdownField("CompanyID", "Company", $companies));
}
}
The Company dropdown is added to to the popup and works fine but I can not get it added to the tablelist what am I doing wrong?
Any help much appreciated!!!