OpenWGA 7.0 - TMLScript reference

Method :


On object WGA
Usage Converts a JavaScript object to the corresponding Java object, making its Java methods accessable

This can be used on any native JavaScript object that has a Java pendant, like Strings, Numbers etc.

For backward compatibility there still is a global function "javaObject()" available whose use is discouraged since OpenWGA 5.3.

Parameters jsObject:
JavaScript object to convert
Return value The java object pendant of the given JavaScript object
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples This example converts a JavaScript string to a Java string in order to call its trim() method which is not available on the JS object. The returned string is again a JavaScript string as TMLScript automatically converts all output objects of Java methods to their JavaScript pendants:

WGA.javaObject("some untrimmed String ").trim()