OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » WebTML » Features » Forms

Persistent forms

By setting attribute persist to "true" on <tml:form> a WebTML form can be marked as "persistent". A persistent form is stored to the users browser session and will be kept until that session is invalidated. The form will be retrievable by its id, given to it by the id attribute on <tml:form>.

Rendering a <tml:form> with the id of a previously persisted form will display the data of that persistent form.

In TMLScript a persistent form, that is not currently rendered on the page, can be retrieved via this.tmlformByID().

In some situations it is difficult to handle the life cycle of a persistent form as there is no automatic way to let it expire. A user may enter and store data in a persistent form, then continue doing something else on this site or somewhere else on the internet. When he returns to the form in the same browser session he will find the data there that he entered some time ago. This may or may not be what is expected dependent on the purpose of the form.

To clear the field and file data of a persistent form a call of tmlform.reset() is suitable. You can also completely remove a persistent form from the current sessions form registry by calling tmlform.remove().