I have a part of a project where I have the user input a very long form. I wanted to break it up a bit so the user would fill out a few fields, click the next button and the next set of fields appears (as opposed to scrolling down).
My set up is such - I have the host/root column container I call Safety
.
In my Safety
column container, I have only 4 items - a header label, an embeded view, and two icons at the bottom for navigation. My Safety
column container has a custom root property I call current step, which is added to or subtracted from based on usage of the navigation buttons at the bottom of the screen. This current step also determines what view is displayed in the embedded view like so -
if({parent.custom.currentStep} = 1,
'Safety/customerInfo',
if({parent.custom.currentStep} = 2,
'Safety/ppeChecklist',
if({parent.custom.currentStep} = 3,
'Safety/hazardousMaterial',
'')
)
)
Now I’m realizing, from my Safety
view which holds the embedded view with the changing paths, I am not sure how to grab the data from the changing views. I know in React you’d do something with a callback function. I’m not quite sure how to do that here. I’m also not quite sure if the fact I have a single embedded view with a changing path is going to make this more difficult or easier.
How can I get the data from the dropdowns/tables/etc in my views that are existing in the embedded view? Alternatively, if there is a better way to make a form that is so long it requires next/back button navigations, I would also accept that as an answer.
Just to make sure I am clear about my setup -
My viewForcurrentStep is an embedded view that uses the path for customerInfo, hazardousMaterial, ppeChecklist depending no what the current step is. How can I get the data from customerInfo, hazardousMaterial, ppeChecklist into the safety view to use for submission of the form?