© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
w5m

Pass form data (`$state`) to `ChartWidget` in resource Create page

I have embedded a
ChartWidget
ChartWidget
in a resource Create page (of type
CreateRecord
CreateRecord
) via the
getFooterWidgets()
getFooterWidgets()
method.

Is there a way for the
ChartWidget
ChartWidget
to access the data in the form fields (e.g. via a
$state
$state
variable or similar) before the form is submitted (i.e. there is no record in the database table yet)?

What I'm trying to do is populate a chart after clicking a "Calculate" button (i.e.
Action
Action
) on the form and would appreciate any thoughts as to how to approach this.

Many thanks.
Solution
where are you using this action?
I think you will need to inject $livewire..

->action(function($livewire) { 
  $livewire->dispatch('updateChartData', data: $livewire->data);
})
->action(function($livewire) { 
  $livewire->dispatch('updateChartData', data: $livewire->data);
})
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to pass custom data in resource create method
FilamentFFilament / ❓┊help
3y ago
Form in resource index page
FilamentFFilament / ❓┊help
2y ago
get all form state on create page
FilamentFFilament / ❓┊help
3y ago
Create Resource from Linked Resource View Page - form error
FilamentFFilament / ❓┊help
2mo ago