Widgets Overview

image_pdfimage_print

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

It is possible within the Widget HTML code to create a hyperlink with the function __hyperlink() or to 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>

As of Jedox 4.0, it is possible to call PHP macros with the function __macro(), and a double array is no longer necessary for a single macro.

Before Jedox 4.0:     __macro([[‘Module1.foo2’, ‘bar2’]])
As of Jedox 4.0:       __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:

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

Related links:

image_pdfimage_print
Was this post helpful?
NoYes (No Ratings Yet)
Loading...