Making a multi-page single view form?

It's going to make it SO MUCH MORE DIFFICULT, because once the View is replaced (when you change the path), all of the data and properties disappear.

There are two ways to accomplish what you're trying to do:

Assuming the user can ONLY MOVE FORWARD AND NEVER BACK, you could use property change events to invoke system.perspective.sendMessage(), where you would essentially broadcast the currentValue.value of the field. You would then need to set up a listener for each of those messages (most likely on the root of the Safety View), so that as those values change you get the new data. The downside to this pattern is that if your users can go "back" (which it looks like they can), then you have to set up parameters for each of the Views you'er using and tie those parameters to the properties stored on the root container.

The better option is to bi-directionally bind the relevant value of each of the fields in each of the Views you're embedding to a session property. This way, as you change each field the session is aware of the value. Should your user go "back" to a section, the binding will result in the fields displaying the values they held before the user navigated away from the View. To obtain the values at any point you would only need to locate the relevant session properties.

1 Like