Chaloman
afterStateUpdated() Not Triggering in a Custom Filament Field
Thread Title:
Issue with
afterStateUpdated()
Not Triggering in a Custom Filament Field with OpenLayers
Body of the Post:
Hello everyone,
I am working with Filament to develop a form that includes an OpenLayers map. I have a custom field that allows users to select a location on the map, and I need the afterStateUpdated()
method to trigger every time the latitude or longitude is updated via a click on the map.
Here is the JavaScript snippet:
- Field Configuration in Filament: My field is configured to handle updates to these properties. However, even though the latitude
and longitude
properties update correctly, the afterStateUpdated()
method that I expect to trigger does not. Here is the relevant configuration:
Problem:
Despite the latitude and longitude properties updating correctly, the afterStateUpdated()
method does not trigger as expected. I would like this method to fire to perform additional logic every time the coordinates change through a map click.
Does anyone have experience with this kind of setup or any suggestions on how I might ensure that afterStateUpdated()
triggers correctly when updating coordinates?
I would appreciate any help or suggestions.5 replies
Can i use in a form a list checkboxex to show or hide other list of checkboxes
In the user model, I have a list of checkboxes that display roles, and another list of checkboxes that show values from a model called 'instruments'. What I'm trying to do is to have the list of instruments displayed when a certain role is selected, and not displayed otherwise. Some of this works, but when I save it, the values disappear even though they are present in the database. If I refresh the page, they appear as I show you in the following video.
Code example
7 replies