Using Notifications in Lianja

From Lianjapedia
Revision as of 06:44, 23 February 2017 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lianja has built-in support for asynchronous "Notifications" using the Lianja system object showNotification() method.

To slide down the notifications panel use:

Lianja.showNotification(MESSAGE as Character, WAIT as Logical [, COUNT as Numeric])

The MESSAGE can contain HTML to format it. You can also include hyperlinks in the HTML of your MESSAGE.

If WAIT is false and the COUNT value is specified it is shown in the "Notifications icon" in the Page HeaderBar. Clicking on the Notifications icon will slide down the notifications panel. You can enable or disable the showing of the notifications icon in the "Page Attributes" dialog.

The LINK handles specially recognized hyperlink Actions specified using href=LINK including the following:

href target Arguments Description
app: yourappname Run the specified App. e.g. app:lianjademo
page: pageid
pageid.sectionid[?action=ACTION]
Select the specified page. e.g. page:customers and optionally perform an ACTION on a specified section within the page.
section: sectionid?action=search&text=value
sectionid?action=first
sectionid?action=last
sectionid?action=next
sectionid?action=previous
sectionid?action=add
sectionid?action=delete
sectionid?action=move:n
sectionid?action=goto:n
sectionid?action=refresh
Perform an action on a section.
recital: functionName(args) Call a Recital function.
vfp: functionName(args) Call a Visual FoxPro function.
python: functionName(args) Call a Python function.
php: functionName(args) Call a PHP function.
jscript: functionName(args) Call a JavaScript function.

This provides you with the ability to click on a hyperlink in the Notifications panel and Transition to a new page/section in your App and position onto a particular record.

Note the the Lianja.showDocument(URI) call also handles these special links (page includes full list).

Notifications are typically handled by the Timer delegate procedure in a page (This is in the Page Attributes dialog).

This is the type of thing you can do:

Notifications


Another good use for the timer delegate is to schedule the running of background jobs and monitor their progress, informing the user when the job has completed using notifications.