Action->form() not getting filled when reusing form
Hello,
Having a
Action
on a view page. I want to reuse the form from InvoiceResource
as i did, but i want to force fill it with data from the $record
, but it doesnt get filled. No errors, just doesnt work;
Any ideas on how to handle this?
3 Replies
->fillform()
For some reason when I tried it yesterday it didnt work, now it does; Thanks a lot!
Also the action form submit in the modal doesnt get saved, how to trigger the save, or how to get the action form state and save it manualy if I need to?
Since it is an
Action
and not EditAction
, you've got to tell it what to do using an ->action( #in here goes my save logic)
method.
You can do it directly in there, with $record->phone = $data->receiver_phone; $record->save()
etc, or you can pass $record and $data off to a handler to dela with that logic, which makes for neater code.