Vulcan
Vulcan
FFilament
Created by Vulcan on 10/17/2023 in #❓┊help
Adding action to widget, modals not opening
So I'm wanting to have some actions on my widgets, think an onboarding flow. I went through https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component And added the traits and interfaces to my widget. But no luck. The action is there, but clicking it doesn't do anything, no confirmation modal. I then tried making a custom livewire component and had the widget create that component, still to no avail
1 replies
FFilament
Created by Vulcan on 4/19/2023 in #❓┊help
Providing a Closure to a Filament\Pages\Actions\Action causing a livewire failure
Not sure if I'm just being dumb, but when I have a page which has a wizard. I have a custom SubmitFormAction:
protected function getSubmitFormAction(): Action
{
return Action::make('save')
->label('Save Recipients')
->disabled(false)
->submit('save')
->keyBindings(['mod+s']);
}
protected function getSubmitFormAction(): Action
{
return Action::make('save')
->label('Save Recipients')
->disabled(false)
->submit('save')
->keyBindings(['mod+s']);
}
That works But if I change that disabled to being a closure, it fails. Eg:
->disabled(function($state) {
return false;
})
->disabled(function($state) {
return false;
})
Error:
Typed property Filament\Pages\Actions\Action::$livewire must not be accessed before initialization (View: /home/<redacted>/website/vendor/filament/filament/resources/views/components/pages/actions/action.blade.php
Typed property Filament\Pages\Actions\Action::$livewire must not be accessed before initialization (View: /home/<redacted>/website/vendor/filament/filament/resources/views/components/pages/actions/action.blade.php
Am I doing it wrong or is this just not something which is supported?
2 replies