kennyhorna
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Sorry, I went into meetings and I forgot about this. But I found this https://github.com/filamentphp/filament/discussions/7221#discussioncomment-6551399
18 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Because if that is in another side and you expect this to update another page (in another tab for example) then you will need to broadcast notifications instead https://filamentphp.com/docs/3.x/notifications/broadcast-notifications
18 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Try adding a
dd('reached!);
inside the method of the listener (refreshBadgeCount()
). Just to double check if it's going inside. Another thing that I noticed is that you have two methods listening to the event. This is not wrong though but I think that the getNavigationBadge()
should be called after the other one, right? If so, then I think you should call it afterwards or inside it. But that's just a comment18 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Is it a typo or the reason why the event is not listened given that you are dispatching
'updated_cart'
-> but listening to 'cart-updated'
? (check the #[On('...')]
)18 replies
Problem when saving a record in a form that contains a table (custom filament Livewire component)
Ok I fixed the problem like this:
- I created a view page for the resource.
- The custom filament component (the table view) is only visible in the view page
- During edition I have the component hidden -> this makes the form to be stored again.
6 replies
Problem when saving a record in a form that contains a table (custom filament Livewire component)
The problem
The problem is when you want to save (after an edit) on the big
SaleTrackingResource
. It just doesn't work or trigger anything.
If I comment out that code, then it works again.
I think the problem is that some events are being registered when the custom component is added that makes the main one to be ignored.
I inspected it with the browser and it doesn't trigger anything.
Have you experience that and know how to solve it? Thanks in advance.6 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
@bardolf_6969 What I ended up doing was a full refresh. Let me share you the details.
1. Event dispatch from
RelationsManager/SectionsRelationManager.php
:
2. Set up listener on list page
PriceListResource/Pages/EditPriceList.php
So, it pretty much does a redirect to the same page.
Ps: The additional parameter that I pass in there is the tab
. This is a query param to set the active tab of the tabs component. Since I'm interested in the tab called "sections", I will check if there is the query param in the url to set it dynamically, because by default it will open the first tab only, even if you refresh the page with another one active.
If you want to know how this works, then you can do this (in the resource):
PriceListResource
:
I hope this helps you.18 replies