© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
barrerakj

How to refresh form fields after action?

I have a very simple action, that looks like this

protected function getActions(): array
    {
        return [
            Action::make('Cambiar a Creada')
                ->action(function () {
                    self::$quoteService->changeStateToCreated($this->record->id);
                    $this->refreshFormData([
                        'stateId',
                    ]);
                })
                ->requiresConfirmation()
                ->modalHeading('Finalizar de llenar y crear cotizacion?')
                ->modalSubheading("Ya no podra revertir los cambios")
                ->modalButton('Si!')
        ];
    }
protected function getActions(): array
    {
        return [
            Action::make('Cambiar a Creada')
                ->action(function () {
                    self::$quoteService->changeStateToCreated($this->record->id);
                    $this->refreshFormData([
                        'stateId',
                    ]);
                })
                ->requiresConfirmation()
                ->modalHeading('Finalizar de llenar y crear cotizacion?')
                ->modalSubheading("Ya no podra revertir los cambios")
                ->modalButton('Si!')
        ];
    }


My focus is on the 'stateId' which you can't see here, but it's a Select field on the resource. This is the code of the select

Select::make('stateId')
                    ->label('Estado')
                    ->options(QuoteState::all()->pluck('name', 'id'))
                    ->relationship('state', 'name')
                    ->disabled()
                    ->hiddenOn('create'), 
Select::make('stateId')
                    ->label('Estado')
                    ->options(QuoteState::all()->pluck('name', 'id'))
                    ->relationship('state', 'name')
                    ->disabled()
                    ->hiddenOn('create'), 


When I open the view page, that Select looks fine (like the first picture you see on this post). But when I trigger the action, everything works fine, but the Select now looks like reseted. It looks like it was "deselected" (as you will see in the second picture). Why is that?



Why
image.png
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

Refresh Form after suffix action
FilamentFFilament / ❓┊help
3y ago
Refresh my form after custom "Cancel" action
FilamentFFilament / ❓┊help
2y ago
How to refresh the whole form, with relationmanagers, after an action?
FilamentFFilament / ❓┊help
3y ago
table action modal form refresh?
FilamentFFilament / ❓┊help
2y ago