Dependent Select inside wizard with repeater not being populated
I have a dependent select on a repeater as part of a 2 step wizard. Whenever I use the select outside the repeater, its option get populated correctly whereas when I put it inside the repeater it does not. Has anyone experienced this? I am not seeing anything on the docs but I could be missing something. The one not populating is the documet_type_id select.
5 Replies
Did you save when it was outside? A repeater is a json / array so a select in a repeater won't be render if the data was saved outside of it since it's now traversing
Do you mean if I saved the jurisdiction outside the repeater? When I reach the 2nd step of the wizard, nothing has technically saved. The flow is the following:
1. On the first step of the wizard I have 2 selects, one of them is hidden until a selection gets made on the first one.
2. I then set the option of the hidden select based on the selection made on the first one.
3. At this point, I am done with the required fields on the first step of the wizard. I click Next and go to the 2nd and last step of the wizard.
4. On the second step I have a "repeater", and inside the repeater I have a select and a FileUpload component.
5. The select should have its options set to be based on the id coming from the jurisdictions component (2nd select from step one on the wizard).
So you are saying that that would not work since the value I need it is coming from outside the repeater?
Ok, so 5th time reading the docs was the charm. I was able to get this working. All I had to do was to properly use the $get to access fields outside the repeater like $get('../../field_name') or in my case $jurisdiction = Jurisdiction::find($get('../../jurisdiction'));
Sorry for the delay. That is exactly what I meant by outside the repeater π
No need to apologize, you were kind enough to reply to the first post..and yes, I reread your response several times until it click on me and I was able to find the correct section on the docs.
Great stuff! Glad you solved it π