Blocking form in content

Would it be possible to make an in content form blocking similar to a pop up form? I have the issue with users navigating away during the creation of an object without canceling or saving which creates those annoying empty records. I know I can get rid of them by running a schedule but it would be better to avoid them all together without irritating the user. The form I am using is pretty large hence I can not use a pop up form.
1 answers

As several commenters noted, making the form blocking does not solve your problem as the user can still navigate to another website or close the browser, resulting in the situation you're trying to prevent.

The problem with creating a new object using a form is two-fold:

  1. The new object is already visible to other users in grids and looks like an empty row.
  2. The new objects are not removed from the database when the user navigates away instead of pressing 'Cancel'.

The first issue can be remedied by adding an attribute that indicates whether an object is new or whether it is an existing object. You would set the state from 'New' to 'Existing' when the user successfully saves the object. In grids, you could add an XPath constraint so that only objects with state 'Existing' are shown.

As you remarked yourself, the second issue can be solved by periodically removing these new objects. A safe bet is that a user does not take more than 24 hours to create an object. Thus, you could create a scheduled event that removes all objects with a createdDate more than 24 hours ago and with state 'New'.