Events - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki
Events are a list of one or more comma ";" separated system or widget method's calls to be executed. Events can contain constants, bindings and evaluations as parameters.
All events have a return value of *boolean. When an event fails, subsequent events in the list are ignored and execution terminates immediately.
Below is a list of non-widget specific methods. Refer to widget documentation for supported method's.
Name | Description |
---|---|
alert
(
[
|
Pops an alert dialog with the specified title and message displayed and the icon defined by type as
See it in Action |
back
(
|
This is a convenience method for close() an is intended for the sole purpose of readability. Refer to the close() method below.
See it in Action |
build
(
|
Builds and parses a new template from the supplied xml string.
If modal is true, the template is opened in a modal window on the same page. If modal is false, the template is opened in a new page pushed onto the naviagtion stack. The transition between pages can be |
clearbranding ( ) |
Application branding is a build in feature in FML mobile for setting a custom icon and title for an application whene the application is launched for the first time.
Once the application has been branded, the only way to clear the brading is via this method. This method is rarely used an is more for development purposes. |
close
(
|
Close pops pages off the navigation stack.
If until is an integer, back will pop the specified number of pages or until the root page is encountered. If until is non-numeric string, until is assumed to be the name of the page. If a page by that name is on the navigation stack, pages ahead of the page are removed from the navigation stack. For example: |
continue
(
[
|
Pops a dialog box with the specified title and message displayed and the icon defined by type as
In addition, the dialog includes 2 buttons, left and right. The left button when clicked returns true, the right button returns false. If false, the method returns false and execution of subsequent methods terminates immediately. This is used quite often when confirming before submission of forms or when exiting a page.
|
copy
(
|
Copies the specified text to the clipboard. If toast is true, a system toast message "Copied to Clipboard ..." is displayed.
See it in Action |
logon
(
|
Negotiates a third party signin using Firebase authentication where
provider is microsoft, facebook, google, etc.
Before use, Firebase must be configured as per these setup instructions. Additionally, the provided FIREBASE_API_KEY and FIREBASE_AUTH_DOMAIN entries must be added to the config.xml file. Default oauth provider scopes are ['email', 'profile']. On valid login, subsequent HTTP requests will include the providers json web token in the request authorization header. Sets {USER.connected} to true and sets a {USER.<claim>} bindable for each public claim in the jwt. It is a good practice for the remote server to validate this jwt with the provider and return a local jwt in the response authorization header as described here. If refreshPage is set, the current page is refreshed after successful logon. This is somewhat tricky to setup for mobile on Android as it requires a custom compile. We can help. Book a meeting with us and lets discuss it. See it in Action |
logoff
(
[
|
Logs the current user out and signs out of third party signin. Sets {USER.connected} to false and clears all {USER.<claim>} bindables.
If refreshPage is set, the current page is refreshed after successful logon. See it in Action |
open
(
|
Opens the a window and loads the specified url where url is a valid web address (ie. http://google.com), a full or partial path to an fml template (ie. /templates/main.xml)
If modal is set, the page is displayed in a popup window. The transition defines how the page animates into view. If replace is set, the current page is replaced by the new page. If replaceAll is set, all pages are removed and the new page is displayed. |
refresh ( ) | Reloads the current page's template from the server and reloads the current page. |
saveas
(
|
Encodes content as UTF8 and launches the platform's file save dialog. |
set
(
|
Alternate method for setting a bindable
Sets the widget property identified by id to the specified value. Example: set('myicon.color','red') |
sound
(
[
|
Plays the specified .wav or .mps sound file located at url for duration seconds or until finished, whichever is less.
If url is not specified, a default beep sound is played. If duration <=0, the sounds plays once to completion. See it in Action |
stash
(
|
Alternate method for setting a STASH value.
Sets the stash key to the specified value. Example: stash('first_name','joe') |
theme
(
|
Set the current theme to the specified brightness (light, dark) and color scheme using the specified google font.
See it in Action |
toast
(
|
Displays the specified message as a system toast for duration seconds. |
wait
(
|
Sleeps for the specified number of seconds before executing the next event in the chain. |