CheckboxList Issue on Custom Livewire page

Hi everyone, I'm having an issue using a CheckboxList on a custom Livewire component. I've only imported the Filament forms as I don't need the entire interface. I'm building a wizard with several steps and some inputs/checkboxes within. Here is the example code:
class AstiWizardComponent extends Component implements HasForms, HasActions
{
use InteractsWithActions;

use InteractsWithForms;

public ?array $data = [];
public $importoMultilinea;
//public $allocazione; <---- IT CAUSE ERROR :(
class AstiWizardComponent extends Component implements HasForms, HasActions
{
use InteractsWithActions;

use InteractsWithForms;

public ?array $data = [];
public $importoMultilinea;
//public $allocazione; <---- IT CAUSE ERROR :(
CheckboxList::make('allocazione')
->options([
'obbligazionaria' => 'Obbligazionaria',
'prudente' => 'Prudente',
'moderata' => 'Moderata',
'azionaria' => 'Azionaria',
'libera' => 'Linera',
])
->reactive()
->columns(5)
CheckboxList::make('allocazione')
->options([
'obbligazionaria' => 'Obbligazionaria',
'prudente' => 'Prudente',
'moderata' => 'Moderata',
'azionaria' => 'Azionaria',
'libera' => 'Linera',
])
->reactive()
->columns(5)
I have mainly two problems: When using the "public $allocazione" variable in the Livewire component, clicking on a single checkbox marks all of them as active. However, if I don't use this variable, the individual checkbox works correctly, but when I click "next" to go to the next step, I receive the error: "No property found for validation: [allocazione]". Could you please help me understand what I am doing wrong? Thank you!
1 Reply
neverender24
neverender246mo ago
you need form fill public function mount(Request $request): void { $this->form->fill(); }
Want results from more Discord servers?
Add your server