Follow

Autosaving

Saving user input automatically when entering content is a highly desirable feature. Users will not have to worry about losing progress if something goes wrong and/or they lose their internet connection.

Autosaving 

Adding autosave functionality to a coach with SPARK is easy using the Stay on Page event with the On Event functionality included in many of the controls.

  1. Add a Stay on Page event to the Coach diagram (renamed to Autosave in this example).
  2. In the coach, add a Navigation Event and change it's Control Id to "Autosave" (or whatever suits your needs).
  3. For any fields you want to save, add ${Autosave}.fire() to the On Blur event. Make sure that any fields you want to be saved are bound to a variable, or they will not be saved.
  4. Attach the Navigation Event to the Autosave event in the Diagram tab. Now whenever your user clicks out of a field they were editing, the content will be saved!

Adding a Timer (optional)

In addition to having your Coach autosave whenever an input loses focus, you can also set your coach to save after some period of time has elapsed (for example, if your user walks away from the computer in the middle of an input, after 5 minutes the form will save).

  1. Add a timer control to your coach.
  2. Set the timeout value to how often you want your coach to save (in milliseconds). Also make sure to set the timer to be repeatable, so your coach will keep saving.
  3. Add ${Autosave}.fire(); to the timers On Timeout event.

Related Article(s)

Timer

 

  • Author: J. Andrew Casey-Clyde
  • Date Created: June 2, 2015
  • Date Modified: June 11, 2015
Was this article helpful?
1 out of 1 found this helpful

Comments