Getting Error in Sudden Change in Tab
I'm using a Custom table which is changing through a Year filter and I 'm getting Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization this error when i suddenly change my year filter
8 Replies
Provide your widget code please.
I'd try and debug this, for example:
return $this->filters['year'] . ' - Report';
filters are part of table, and it looks here you are trying to set the title before the table is initialised. Please try commenting this out.
Still getting the error Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization
Is it only when you select the filter? If so can you provide the filter as you are using the page filter/code.
here i sthe code
got the solution the error is gone by using this
For anyone stumbling across this, setting is $isLazy fixed an issue for me where I had multiple table widgets on a dashboard, using a filtersForm() on the dashboard and InteractsWithPageFilters on the widgets. Without setting $isLazy false for all table widgets, I was getting intermittent "table must not be accessed before initialization" when changing any of the filters. Setting $islazy to false for all table widgets fixed the problem.