OpenWGA 7.5 - WebTML reference


WebTML default actions

WebTML actions are procedures that are called from a WebTML page or from other procedures as well. They normally execute custom TMLScript code that needs to be defined, but there also is a number of predefined WebTML actions that can be used directly. Those are called WebTML default actions and they offer very common functionalities to be used in most OpenWGA developments, like setting WebTML variables or storing WebTML forms to their data source.

Their usage scheme is identical to using normal WebTML actions as they are addressed by an individual action ID. Each default action has a predefined ID which, to differ it from normal actions, starts with a dollar sign "$":

<tml:form id="testform" source="content">

Input: <tml:input name="field"/>

<tml:button clickaction="$store">Speichern</tml:button>

</tml:form>


Note that all default action are debounced, so an action link of any type will only execute the action once, no matter how often it is called.

This section of the documentation lists all available default actions. For more information about WebTML actions in general see the WebTML actions chapter on OpenWGA Concepts and Features.

action="$attach"

Description: Attaches all files that were uploaded to the current WebTML form to the content document in the current context and saves it. This is a master action and therefor not dependent on the current users access rights.

action="$delete"

Description: Deletes the content document in context
Parameters:

This action can be used with HDBModel contents. Here it will delete the complete page and trigger alle neccessary events.

If the context of the current WebTML portlet is located on the document to delete then the action will move the portlet context to its parent document, if available. If not available then the portlet context will be set to "none".

action="$fireevent"

Description:

Fires a portlet event

This fires a simple portlet event without any parameters from the current WebTML portlet.

Debounced: true
Parameters: param1: The event name

action="$login"

Description:

This action performs a user/password login to an OpenWGA domain.

It may take the login data either via WebTML params or from the submitted WebTML form. In the latter case it uses the following field names:

  • "user" or "username": The login username
  • "password" or "pwd": The login password
  • "domain" (optional): The OpenWGA domain to login to. Omit this to perform a login on the domain of the application currently in WebTML context.
  • "redirect" (optional): An URL to redirect to after a successful login
When the login fails there is no redirection performed and the WebTML variable "loginerror" is defined with value 1.
Parameters:

param1: The login username

param2: The login password

param3: The login domain

param4: An URL to redirect to after successful login

action="$refresh"

Description: Just reloads the current WebTML page or AJAX portlet.

While this action itself has no functionality it may be useful to trigger functionalities that occur on the reload. For example you might use $refresh as change action on a <tml:input type="select"> field to allow the WebTML form code to react on a newly chosen value.

action="$reset"

Description: Resets the current WebTML form.

This equals a call to the TMLScript method tmlform.reset().

action="$setpvar"

Description:

Sets one or more normal WebTML portlet variables.

This action has two, modes differing in the parameters that are used:

If two parameters are used then those are used to set a single variable. As WebTML action parameters can only be strings this can only used to set string variables.

If no parameters are given but a WebTML form is submitted then all fields of the WebTML form will be stored as variables, field name used as variable names, field value as variable values.

Parameters: param1: Name of the variable

param2: String value of the variable

action="$setsessionvar"

Description: Sets one or multiple WebTML session variables.

This action has two, modes differing in the parameters that are used:

If two parameters are used then those are used to set a single variable. As WebTML action parameters can only be strings this can only used to set string variables.

If no parameters are given but a WebTML form is submitted then all fields of the WebTML form will be stored as variables, field name used as variable names, field value as variable values.

Parameters: param1: Name of the variable

param2: String value of the variable

action="$setvar"

Description: Sets one or more normal WebTML variables.

This action has two, modes differing in the parameters that are used:

If two parameters are used then those are used to set a single variable. As WebTML action parameters can only be strings this can only used to set string variables.

If no parameters are given but a WebTML form is submitted then all fields of the WebTML form will be stored as variables, field name used as variable names, field value as variable values.

Parameters: param1: Name of the variable

param2: String value of the variable

action="$store"

Description: Stores the current WebTML form on its data source, including all fields and uploaded files

This action stores the data of the form on the based content document, profile or portlet configuration, depending on the setting in WebTML form attribute source. The behaviour is the same as documented for TMLScript method tmlform.store().

action="$setpsessionvar"

Description: Sets one or more WebTML portlet session variables.

This action has two, modes differing in the parameters that are used:

If two parameters are used then those are used to set a single variable. As WebTML action parameters can only be strings this can only used to set string variables.

If no parameters are given but a WebTML form is submitted then all fields of the WebTML form will be stored as variables, field name used as variable names, field value as variable values.

Parameters: param1: Name of the variable

param2: String value of the variable