Problem with afterStateUpdated in ViewField
Why after I upgraded my Filament to v3, the afterStateUpdated in ViewField is not working anymore?
I want to fill other inputs based on data in ViewField.
14 Replies
could you share the code?
Here..
In this ViewField, user is searching for prospek_id based on name or phone, using api endpoint to return the selected data.
How are you updating this property and sending it to the server?
Are you using something like
wire:model.live="{{ $getStatePath() }}"
?Yes..
It was supposed to work.. could you share?
the view blade?
It's quite long script
https://codeshare.io/de6AXg
I tried simplified the afterStateUpdated method with
Still not updated in nama property.
try a simple input as
<input type="text" wire:model.live="data.prospek_id">
and check if it works
I think this should be data.prospek_id
if you are using a resourcethe prospek_id input is updated with type text after user select the option, but the other input in afterStateUpdated is not..
first of all, you should check if the reactivity is working with a simple input
thanks for your answers, I'll try..
I just found out, that from filament v2, I updated the state from js, saddly it's not working anymore in v3.
I updated the state in js function with
How can I trigger the state to be updated from js?
you can check my js method in line 86
$wire.prospek_id
?it shows $wire is not defined in console
i tried using state, still not triggered to update
I try another way to fill other input also from the js with
but I need some php script to run after i updated the prospek_id state, in afterStateUpdated.
Solution
nevermind, I'll just found out how to call livewire method from alpine..
still, I don't understand what is the cause problem of this thread