Hi! I am trying to update a model using a custom popup form. I have used the example from the tutorial page, but i get a error when i am trying to use the Record finder to change the entry. Here is the code i am using:
public function onLoadCreateUpdateForm(){
$model = Ticket::findOrFail(post('ticketId'));
$this->vars['model'] = $model;
$config = $this->makeConfig('$/db/apollo/models/ticket/fields.yaml');
$config->alias = 'updateForm';
$config->arrayName = 'Ticket';
$config->model = $model;
$widget = $this->makeWidget('Backend\Widgets\Form', $config);
$widget->bindToController();
$this->vars['widget'] = $widget;
return $this->makePartial('form_update_ticket');
}
field.yaml:
device:
label: 'Device model'
oc.commentPosition: ''
nameFrom: name
descriptionFrom: description
list: $/db/apollo/models/device/columns.yaml
span: full
type: recordfinder
tab: Basic
Error: "A widget with class name 'updateFormDevice' has not been bound to the controller" on line 517 of /modules/backend/Classes/Controller.php"