Is there anyway to reload RelationManager Owner page with Spa mode?

In my CreateAction of the RelationManager, I have update some ower model data, I then want it to refresh. The code here I use rediret to refresh it. I would like to just reload the form or load it in spa mode. Is there any way to do that? #relationmanager #ownerpage
No description
No description
Solution:
- add an event in the Edit/View Page https://livewire.laravel.com/docs/events#listening-for-events - dispatch in your action $livewire->dispatch('refresh-page');...
Jump to solution
4 Replies
Expecto Patronum
Im sorry for not answering your question . But im admire on your layout . Very simple and nice looking . Is there by any chance i want to see how you design like that? Im still new in filment . If you okay maybe can share to me in dm probaby?
Solution
LeandroFerreira
LeandroFerreira7mo ago
- add an event in the Edit/View Page https://livewire.laravel.com/docs/events#listening-for-events - dispatch in your action $livewire->dispatch('refresh-page');
Zen Nitiruj
Zen NitirujOP7mo ago
Hi Leandro. Do I have to create a custom view for parrent page in order to put javascript to listen to the dispatch event? I got it now.
johnnie_littleshoes
for other noobs like me that find this thread, this is how I applied it to my case: I have a Resource with a RelationManager. The Resource's ViewPage has a HeaderAction that updates the Resource's status. Based on this status, the RelationManager should also change, but it normally takes a page reload to see those changes. To trigger the page reload, I added $this->dispatch('status-updated'); to the HeaderAction in the ViewPage. Then back in the RelationManager, I added #[On('status-updated')] right before the class ExampleRelationManager extends RelationManager and after the imports. You gotta import use Livewire\Attributes\On; as well.
Want results from more Discord servers?
Add your server