OpenWGA 7.9 - TMLScript reference

TMLForm "tmlform"
Method :

store()

On object TMLForm "tmlform"
Usage Stores the form data to the source of the form
Description

This method is the TMLScript pendant of default action $store. It transmits the form data back to its individual data source, mostly determined by the source attribute of <tml:form>:

  • On source "content" the form saves the form data back to the content document that was in context when the form was created. Form fields will be stored into items (or metadata fields if declared as such). Additionally file attachments will be synchronized between form and document. Files removed from from form will also be removed from the document. Updated files will also get updated on the document. New files will be added to the document.
  • On source "profile" the form saves the form data back to the user profile of the current user.  Form fields will be stored into user profile items (or metadata fields if declared as such).
  • On source "portlet" the form saves the form data back to the configuration of the current WebTML portlet. Form fields will be stored into portlet items.
  • On source "none" or "newcontent" this method can only be used for HDBModel contents. In that case a new content document will get created below the current form context in the specified content class. Besides that the same data transfers are done like on source "content".

Before transmitting the data this method triggers the form validation. If validation fails the operation is canceled and this method returns false. If saving failed because of some other cause this method throws an error.

Methods tmlform.storeInContent()tmlform.storeInPortlet() and tmlform.storeInProfile() are older versions for the same purpose.

Return value true if the store operation succeeded, false if it didn't because of failed validations (Boolean)
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions