slakkie
How to refresh a relationManager after Action on Owner.
Hey @Dennis Koch just wanted to share this: https://github.com/filamentphp/filament/discussions/7221#discussioncomment-6551399 🙂
13 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Hey no worries, thanks for all your help! It's really quite a draw-back that there is not comms between some components. It goes against logic 🙂
I've settled on refreshing the page:
Again thanks for you help!!
18 replies
How to refresh a relationManager after Action on Owner.
Hey @Dennis Koch thanks again for all the help. Seems like the badge just takes in a string it is not Htmlable, which would mean I need to override: resource\views\component\sidenav\item.blade.php ... and that is of course not optimal.
I think for now I am going to settle on this non-optimal way:
Again thanks for the help!! Hopefully it's something that will be easier in the future.
13 replies
How to refresh a relationManager after Action on Owner.
interesting ok going to give that a shot on the method in the Page which gets the count:
Just for interest sake on: https://filamentphp.com/docs/3.x/notifications/sending-notifications#dispatching-livewire-events-from-notification-actions
There is a method on the notifications component, which can do:
So when I bring in the $action that method also exists on it for example:
But not sure yet how that works and what the name is of the component I just pulled that name with the getName() method of the Cart component. Anyway will quickly try that Alpine way
13 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
So the product list page is a resource with a table which also have the button to add something to the cart. The Cart Page is a separate component, when viewing the products the cart only have a navigation item with a badge with the number of items in the cart.
18 replies
How to refresh a relationManager after Action on Owner.
Hey @Dennis Koch trying to figure out what the correct way to dispatch a Livewire Event and Listener. Can't seem to find specifics in the docs. Do you maybe have some pointers, I've tried and search a lot:
I have a ProductResource and next to each product in a filament table I have a add to cart button/action:
First when I try to dispatch the event like in the above code I get an error: Using $this when not in object context
Also tried the one below does not throw an error but I am also not sure if the event is even dispatched at all:
There's a simple filament page with a side navigation and a badge counter. I've tried various ways to listen for the event without getting it to refresh. When a user add an item to the cart the counter should update via listening for the 'updated_cart' event:
I suspect dispatching is the problem.
13 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
I've fixed that typo, still not working, I think the issue is how to dispatch the event. As mentioned in my code above when I do: $this->dispatch() it gives me the error.
18 replies
How to re-render/refresh the parent form after a new entry of a RelationManager has been created?
Hey @kennyhorna seems like you've played with dispatching and listening to events. I'm going crazy on this one. Here my scenario using filament 3 :
I have a ProductResource and next to each product in a table I have a add to cart button/action:
First when I try to dispatch the event like in the above code I get an error: Using $this when not in object context
I've tried various variants for example, the one below does not throw an error but I am also not sure if the event is even dispatched at all:
There's a simple filament page with a side navigation and a badge counter. I've tried various ways to listen for the event without getting it to refresh. When a user add an item to the cart it should update via listening for the 'updated_cart' event:
Do you have maybe any tips or tricks for this?
18 replies