© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Jon Mason

table action modal form refresh?

Since I've been unable to get the FileUpload component to display a preview when a file is present on the model, I decided to make a custom "FileAttachment" field, that shows the attachment and has a button to click to remove the attachment. I'm using this inside of a table row action and it's working as expected except the form isn't updated when the wire:click event is completed.

EditAction::make('editTransaction')
...
->form([
   FileUpload::make('document')
                            ->label('Attach Document')
                            ->preserveFilenames()
                            ->acceptedFileTypes(['application/pdf', 'application/jpeg'])
                            ->maxSize(12288)
                            ->live()
                            ->visible(fn (Model $record) => empty($record->document_id))
                            ->storeFiles(false),
                        FileAttachment::make('attachment')
                            ->description(fn (Get $get) => $get('file_name') ?? null)
                            ->live()
                            ->id(fn (Model $record) => $record->document_id)
                            ->visible(fn (Model $record) => !empty($record->document_id))

                    ])
EditAction::make('editTransaction')
...
->form([
   FileUpload::make('document')
                            ->label('Attach Document')
                            ->preserveFilenames()
                            ->acceptedFileTypes(['application/pdf', 'application/jpeg'])
                            ->maxSize(12288)
                            ->live()
                            ->visible(fn (Model $record) => empty($record->document_id))
                            ->storeFiles(false),
                        FileAttachment::make('attachment')
                            ->description(fn (Get $get) => $get('file_name') ?? null)
                            ->live()
                            ->id(fn (Model $record) => $record->document_id)
                            ->visible(fn (Model $record) => !empty($record->document_id))

                    ])


//called from wire:click on my custom field blade file.
public function removeAttachment($id)
    {

//do delete stuff
$this->form->fill() //not working, which I kind of expect given the context of a table row action, but not sure what else to try.
//called from wire:click on my custom field blade file.
public function removeAttachment($id)
    {

//do delete stuff
$this->form->fill() //not working, which I kind of expect given the context of a table row action, but not sure what else to try.
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

Modal action or table inside form
FilamentFFilament / ❓┊help
2y ago
Modal Action in Form with Table Modal Body
FilamentFFilament / ❓┊help
9mo ago
Widget Table Action with modal form - dispatch refresh event not working
FilamentFFilament / ❓┊help
6mo ago
Refresh Custom Modal Form
FilamentFFilament / ❓┊help
3y ago