Problem with afterStateHydrated
In a custom page, I am trying to set my toggle buttons default value based on its dynamic options. The options are based on different field values.
I have tried both default() and afterStateHydrated(). Even though I can populate the options correctly, I can not access the fields options in either of those methods when the options are dependent on other fields. How can I fix this?
Assume: $get('dob') = '02/20/2022' and $get('prematurity_id') = '02/30/2022'
This correctly gets the options
Trying to set the default, but $component->getOptions() returns null
If I don't try to GET the value from other fields, this correctly sets the default
I have tried both default() and afterStateHydrated(). Even though I can populate the options correctly, I can not access the fields options in either of those methods when the options are dependent on other fields. How can I fix this?
Assume: $get('dob') = '02/20/2022' and $get('prematurity_id') = '02/30/2022'
This correctly gets the options
Trying to set the default, but $component->getOptions() returns null
If I don't try to GET the value from other fields, this correctly sets the default
