Accessing form data in suffixAction form.
Hi guys
I'm currently trying to access data from the parent form in the suffixActions form.
Here's my code:
So in action() I receive the correct value, in options I don't.
Thanks for your help.
I'm currently trying to access data from the parent form in the suffixActions form.
Here's my code:
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('part')
->reactive()
->suffixAction(
Action::make('add')
->action(function (array $data, Forms\Get $get) {
$get('part'); // returns correct value
})
->form([
Forms\Components\Select::make('bom')
->live()
->options(function (Forms\Get $get, $state) use () {
$get('part'); // is null
})
])
)public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('part')
->reactive()
->suffixAction(
Action::make('add')
->action(function (array $data, Forms\Get $get) {
$get('part'); // returns correct value
})
->form([
Forms\Components\Select::make('bom')
->live()
->options(function (Forms\Get $get, $state) use () {
$get('part'); // is null
})
])
)So in action() I receive the correct value, in options I don't.
Thanks for your help.