karikas
How to trigger a Livewire component update after saving an Edit form?
Fantastic @Leandro Ferreira , that did it! It's perfect - thank you very much for your help! I hadn't realized that I could just call
$this->dispatch()
from the EditPage, that was the tricky part for me. Thanks again.7 replies
How to trigger a Livewire component update after saving an Edit form?
Hey thanks for the reply! My Livewire component is referencing the $record just like the docs suggest, and that's how it's showing the record's data initially, but it does not automatically update the data when the form updates unless I dispatch a refresh event. When I do a refresh event all the $record references update perfectly, but right now I'm only able to dispatch that refresh on individual field updates with
afterStateUpdated()
.
I would really like to have just one place in the code that dispatches that refresh when the whole form is saved, and I thought that would be an afterSave()
method in my Edit page php file, but I haven't found a way to access Livewire from that function to do the dispatch.
Hope that makes sense, I've been coding for a zillion years but Livewire and Filament are both pretty new to me, so I may be taking the wrong approach here or overlooking something.7 replies