Adding actions modal on getHeaderActions

I have some issue when doing this, when i adding Action modals on ViewPage at getHeaderActions()
protected function getHeaderActions(): array
{
return [
Action::make('example_action')
->label('Example Action')
->form([
TextInput::make('example_input')
->label('Example Input')
->required(),
]),
];
}
protected function getHeaderActions(): array
{
return [
Action::make('example_action')
->label('Example Action')
->form([
TextInput::make('example_input')
->label('Example Input')
->required(),
]),
];
}
the modal did not showing, and when i click the action button, some components being buggy(gone), did i missed something?
5 Replies
Julien B. (aka yebor974)
Maybe because you don’t return an array for your getHeaderActions function 😄
zydnrbrn
zydnrbrnOP2w ago
here is error from console
"Could not find Livewire component in DOM tree"
"Could not find Livewire component in DOM tree"
sorry i missed the array for that example 🤣
Julien B. (aka yebor974)
Is it a custom view for the ViewPage ? Maybe missing <x-filament-actions::modals /> in view and check if you have the InteractsWithActions trait.
zydnrbrn
zydnrbrnOP2w ago
Im use ViewRecord, would it be better if i changed it to custom view or custom page?
Julien B. (aka yebor974)
Strange. Could you please share you ViewPage code and view if customized
Want results from more Discord servers?
Add your server