I am trying to add an UploadField to ModelAdmin by creating an extension, after the GridFieldList. But I always get an error " Call to a member function FormAction() on a non-object in ..../framework/forms/FormField.php on line 161". I can add TextField,DropdownField without any problems, but no luck with UploadField. Did I miss something?
<code>
class MyExtension extends Extension{
public static $has_one = array(
'ImportCSV' => 'File'
);
public function updateEditForm($form){
$fields = $form->Fields();
$fields->push(
new TextField('Title', 'Title')
);//This one works
$fields->push(
new UploadField('ImportCSV', 'Import CSV')
);//This one not working
}
}
</code>