F
Filament5mo ago
slamx_

Get Form value inside Tabs

When I use a tab layout for a form, the transfer of a value does not work between two tabs - how can I fix this?
Tabs\Tab::make('Erinnerungen')
->schema([
Select::make('assigned')
->label(__('Assigned'))
->multiple()
->live()
->afterStateUpdated(function (\Filament\Forms\Set $set, $state) {
$set('user_group', null);
$set('select_all', false);
})
->options(portaluser()->userOptions()),
])
Tabs\Tab::make('Reminder')
->schema([
Repeater::make('reminder')
->label('')
->defaultItems(0)
->maxItems(3)
->schema([
Checkbox::make('customusers')
->label(__('Reciver'))
->live(),
Select::make('users')
->label(__('Reciver'))
->multiple()
->default(function(Get $get){
dd($get('assigned'), $get('title')); ## returns null
})
Tabs\Tab::make('Erinnerungen')
->schema([
Select::make('assigned')
->label(__('Assigned'))
->multiple()
->live()
->afterStateUpdated(function (\Filament\Forms\Set $set, $state) {
$set('user_group', null);
$set('select_all', false);
})
->options(portaluser()->userOptions()),
])
Tabs\Tab::make('Reminder')
->schema([
Repeater::make('reminder')
->label('')
->defaultItems(0)
->maxItems(3)
->schema([
Checkbox::make('customusers')
->label(__('Reciver'))
->live(),
Select::make('users')
->label(__('Reciver'))
->multiple()
->default(function(Get $get){
dd($get('assigned'), $get('title')); ## returns null
})
2 Replies
toeknee
toeknee5mo ago
Each tab has it's own state. do a dd of ($get()) and you will see the hirarchy and just run what you need for it to work by traversing the system.
slamx_
slamx_OP5mo ago
a dd of $get() returns a error: Too few arguments to function Filament\Forms\Get::__invoke(), 0 passed in and a dd($get) shows only the current component details (in this example the select users) try any possible print for $get without the hiarchy
Want results from more Discord servers?
Add your server