© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
bwurtz999

Updating a Relation Manager Form Without Closing

Hey all - I am upgrading my Livewire version to
3.5
3.5
from
3.3
3.3
and I've run into a problem. I need to update a relation manager form without closing it and reopening it.

In the old version, I use the following:

// form schema for edit order in relation manager
// other form info
Actions::make([
  Action::make('submitThisMeal')
    ->label('Submit')
    ->action(function () {
      // handle submission and create selection
    })
    ->after(function ($livewire) {
      $livewire->dispatch('refreshModal');
    })

// OrdersRelationManager
#[On('refreshModal')]
    public function refresh(): void
    {
        // unset the form
        unset($this->cachedForms['mountedTableActionForm']);
        // reload the form
        $this->cacheForm('mountedTableActionForm', null);

        // application logic to find new selection...
        // set form with new data
        $this->mountedTableActionsData[0]['existingSelectionInfo'][$selection->meal->menuCategory->name][$selectionIndex]['mealId'] = $selection->meal_id;
        }
}
// form schema for edit order in relation manager
// other form info
Actions::make([
  Action::make('submitThisMeal')
    ->label('Submit')
    ->action(function () {
      // handle submission and create selection
    })
    ->after(function ($livewire) {
      $livewire->dispatch('refreshModal');
    })

// OrdersRelationManager
#[On('refreshModal')]
    public function refresh(): void
    {
        // unset the form
        unset($this->cachedForms['mountedTableActionForm']);
        // reload the form
        $this->cacheForm('mountedTableActionForm', null);

        // application logic to find new selection...
        // set form with new data
        $this->mountedTableActionsData[0]['existingSelectionInfo'][$selection->meal->menuCategory->name][$selectionIndex]['mealId'] = $selection->meal_id;
        }
}


Basically, this is all happening on the
EditEvent
EditEvent
page. Each event can have many
Orders
Orders
. Each
Order
Order
has many
Selections
Selections
. I want users to be able to make selections and view the menu they have picked in real time in the modal that appears (updating after each selection). The selections appear at the top of the form and the section to make a new selection is at the bottom. This works in
3.3
3.3
but not above. Does anyone know why?

In general, can anyone suggest a better way to present what I am talking about? I don't like my current solution but it works.

Thanks in advance
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filament Relation Manager - Form Not Updating
FilamentFFilament / ❓┊help
2y ago
Relation manager form
FilamentFFilament / ❓┊help
2y ago
Relation manager - embed in form?
FilamentFFilament / ❓┊help
3y ago
Relation manager when creating a new relation refresh form values
FilamentFFilament / ❓┊help
3y ago