Dirty data tracking is a new feature in Oracle Visual Builder Studio 2307. It helps you track whether the user modified the value of any variables on the page. This is quite useful, for example, if you need to react to cases where the user might lose unsaved data when navigating away.
You can control which variables to track by setting their "Dirty Data Behavior" property to "Track". Visual Builder tracks all the variables with this status across your page.
A new declarative action chain Get Dirty Data Status is used to find out if there are dirty variables – a status of "dirty" will be returned if variables changed their value.
A second action chain Reset Dirty Data Status resets the status back to not dirty. You'll use the reset when you want to indicate that the values are no longer considered dirty. For example you can call this method after the user saved their changes. Note that as seen in the video below, you would also want to reset a the status after you initially populate a variable with data from a REST backend and before the end user modifies things.
With these new features in place it is quite easy to build a mechanism into your page that will warn users of unsaved changes before they leave a page. Here is a quick video showing how to build such behavior.
In the demo we are creating a reusable action chain that checks the status and notifies of unsaved changes. We then invoke this method from various places in the page including in the vbBeforeExit event of the page. The video also shows how to return specific results from an action chain and examine the value in chains that call that action chain.
