Widgets Overview
Widgets are special mini-applications that can be embedded in a Jedox Web Spreadsheet. Technically, they consist of HTML and JavaScript code that is either directly fetched from the API of an external source (such as Google Maps) or — similar to a macro — defined within the application itself.
Some examples of widgets include:
- news ticker that refreshes automatically
- graphic clock
- integrated calendar tool
- map*
Data can be passed to widgets from the worksheet, and the widget can return data to the worksheet.
Widget enhancements
Within the Widget HTML code, you can create a hyperlink with the __hyperlink()
function.
You can call the function __macro()
with three possibilities.
Examples of function calls:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<p>Function Test</p>
</head>
<body>
<button type="input"
onclick="__hyperlink('/Jedox/Financials/charts');">Link</button>
<button type="input" onclick="__macro([['hl', '/Jedox/Financials/charts']]);">Link over macro</button>
<button type="input" onclick="__macro([['msg', 'warn', 'Test title', 'Test msg']]);">Show message</button>
<button type="input" onclick="__macro([['logo']]);">Logout</button>
</body>
</html>
You can call PHP macros with the function __macro(). A double array is not necessary for a single macro.
__macro(['Module1.foo2', 'bar2'])
__macro([['Module1.foo2', 'bar2'], ['Module1.foo3', 'bar3'],…])
bar2
and bar3
are values that are passed to the macro foo2
or foo3
.
The PHP API has the following functions to access some of the features of Jedox from external PHP scripts:
Function | Behavior |
jedox_is_logged_in() | TRUE/FALSE if the current user is logged in |
jedox_get_username() | Gets the user name of the logged in user |
jedox_get_password() | Gets the password of the logged in user |
jedox_get_groups() | Gets the groups of the user |
jedox_get_locale() | Gets the current locale of the user |
jedox_get_theme() | Gets the current theme of the user |
jedox_get_sid() | Gets the current session ID of the user |
*Note: a valid API key and a Google Cloud Platform billing account are required to access the core Google Maps API, which is required for Jedox reports and widgets that use Google Maps. For more information, see Google Maps Platform.
Related links:
Updated November 4, 2024