OpenWGA 7.8 - JavaScript reference

Method :


On object WGA.ajax
Usage Calls a WebTML AJAX action from JavaScript

This function takes a JavaScript object "params" containing several parameters about the called action.

The action link generated by <tml:action ref="actionid"> determines the action to be called and the WebTML action parameters of the call. It must also be generated with AJAX enabled, using the ajax attribute.

Optionally the call can also be provided with URL parameters in the "params" property, which have the advantage over action parameters to be determinable on the client side by the JavaScript itself. All values on this params object will get converted to strings when they are converted to URL parameters. The WebTML action code can retrieve these parameters using method this.request.getParameter(paramName).


params (JavaScript object):

An object containing parameters as properties. Valid properties are:

  • action (String): Action link of the called action, generated by <tml:action ref="actionid"/>
  • graydiv (Boolean, optional): Determines if the portlet should be "greyed out" while the action is called
  • callback (JavaScript function, optional): A function called after the AJAX response returns. Gets the XMLHTTPRequest object that was used to execute the AJAX request as single parameter.
  • mode (String, optional): Should be set to "norefresh" if the action called is also of AJAX type "norefresh".
  • params (JavaScript object, optional): An object whose properties are to be used as URL parameters on the action call, using property name as parameter name and property value as parameter value. Specifying multi-value parameters is not supported. Parameter values are automatically encoded in UTF-8, so using this OpenWGA output encoding is strongly encouraged when using this functionality with non-ASCII text values.

Calling a simple AJAX action. Note the embracing string delimiters around <tml:action>, so the returned action link generated by that tag is given as string to the function:


  action: "<tml:action ref="$store" ajax="true"/>",

  graydiv: true