#Wizard 1st step, not passing $get data to 2nd step made of Livewire component for filtering rows
14 messages · Page 1 of 1 (latest)
Wizard 1st step, not passing $get data to 2nd step made of Livewire component for filtering rows
So $get data is passed between steps... but the problem is each tab is a container and an element in it's own. So you need to get the steps by traversing out, then into the next step.
so dd:
$get('../../')
would or should show the data structure.
$get is getting correctly the updated values of the Select fields of the step 1. But it seems that the livewire component is sleeping and it's not getting the data passed from the closure.
and if I dd the $get('filter_facility') etc. in the closure, of Livewire::make, I can see the values
should I try to dd exactly like this dd($get('../../') )? Because in that case, I'm getting null. Not sure about the syntax if it's correct...
try a few, it'll be in there somewhere.
dd($get('../'))
or
../../../
You ca use absolute too if really wanted... see:
It looks like you have some custom / bespoke schema/data going on here.
Have you mounted the data on fill?
The table is including all the rows because the filters are not being passed.
You are not filling the form by the looks of it.
public function mount($filterFacility = [], $filterRoles = [], $filterCompany = [], $filterNewsletter = [])
{
$this->filterFacility = $filterFacility;
$this->filterRoles = $filterRoles;
$this->filterCompany = $filterCompany;
$this->filterNewsletter = $filterNewsletter;
}
to
public function mount($filterFacility = [], $filterRoles = [], $filterCompany = [], $filterNewsletter = [])
{
$this->filterFacility = $filterFacility;
$this->filterRoles = $filterRoles;
$this->filterCompany = $filterCompany;
$this->filterNewsletter = $filterNewsletter;
$this->form->fill([]);
}
made the change but still not working.
Don't know if I need to use this refreshTable: https://filamentphp.com/docs/3.x/tables/advanced#resetting-the-table (and where)