Fill form data via emitted action

Is it possible to fill form data via an emitted action?

I do have an action:

Action::make('apply')
    ->action(function ($record) {
        $this->emit('applySelection', $record);
    }),


which should do the following:

public function applySelection($record): void
{
    $formData = $this->form->getState();
    $this->form->fill($record);
}


but it seems like the form always get submitted instead of filling in the data in the corresponding fields.
Was this page helpful?