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
toeknee
toeknee9mo ago
Provide your widget code please.
toeknee
toeknee9mo ago
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.
hello_world
hello_worldOP9mo ago
Still getting the error Typed property Filament\Widgets\TableWidget::$table must not be accessed before initialization
toeknee
toeknee9mo ago
Is it only when you select the filter? If so can you provide the filter as you are using the page filter/code.
hello_world
hello_worldOP9mo ago
here i sthe code
hello_world
hello_worldOP9mo ago
got the solution
protected static bool $isLazy = false;
protected static bool $isLazy = false;
the error is gone by using this
cheesegrits
cheesegrits5mo ago
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.

Did you find this page helpful?