Trigger Page Reload from Admin Resource?
I've got some logic that happens when a model is saved and a custom component to render the result of that (in this case, an image variant.) But it does not refresh on form save and I can't seem to find a way to make that happen within the Filament/Livewire universe. However, I'd be perfectly happy to just have the page reload after save. I realize this is probably a dumb question, but is there a way to reload the edit page after save?
9 Replies
I’m interested in this as well. Using
redirect
currently causes the $this->previousUrl to be updated with current page url and causes the back/cancel button can’t go back to previous page properly@saadeguilherme brilliant! Thank you. This definitely seems like it should solve the problem.
Update for v3:
and
In v3 you can just
$this->js("window.location.reload");
you don’t need a render hookOh nice. Thanks!
Hmmm ... I just tried that, but the page is not reloading, and the console logs:
$this->js('window.location.reload()');
?$this->dispatch(‘$refresh’)->to(YourComponent::class)
Then register listener on your target component
protected $listeners = [‘$refresh’]
Oh, duh. I should have thought of that. Yes, adding the
()
makes it work. Thanks!