Description
Build.One offers the opportunity to use and also update the Notification Messages which will displayed to the user.
Attributes
Here are all possible attributes of the messages listed
Attribute name | Description | Files |
---|---|---|
text | The text that will be displayed in the notification message | |
type | Available values: success, question, information, warning, error, link | |
title | The title of the notification message | |
moreText | The text displayed when clicking on the 'more text' button in the notification. Not used when displaying a link. Not shown when message type is warning. | |
expire | The expiration time of the notification message. 0 if no expiration needed | |
message | The text displayed when displaying a link. Otherwise, the text from the 'text' attribute is used. | |
linkValue | The value of the link. Only used when displaying a link message. Link value can be the name of a dialog (ex: sampleuserdyndialog). On click, the dialog will open. | |
linkDesc | The description of the link. Only used when displaying a link message (either 'link' type or 'linkValue' value set) | |
bottom | Bottom text. Only used when displaying a link message (either 'link' type or 'linkValue' value set) | |
options | Only when using a link message (either 'link' type or 'linkValue' value set). Even for links, it is only used when callAkiomaCode is invoked (the link value starts with '$'). Represents the caller object (controller or dynObject). Currently, from the backend this is sent as a string, while the frontend expects an object. | |
user | The user name or user tenant combo which is meant to receive the message. Ex. For link message, if no username is supplied, all the logged in users will receive the notification. User parameter allows for sending either username or username@tenant combo. The combo ensures that if multiple users are with the same name are present across multiple tenants, only the user from the specific tenant will receive the update. (ex: 'axadmin' or 'axadmin@master') | |
doc | Used only for opening documents. Represents the document link | |
docDesc | Used only together with doc. Specifies the document description in the notification message |
In order to make it easier to do this, the id of the newly created notification is returned. This is also needed in order to update the message. You can specify the id yourself or one will be automatically generated.
How to use it
Frontend
Javascript
You can create a notification message by executing the following Javascript code: akioma.notification({/* parameters here */}).
Here, you can add an additional parameter to specify if you want the original dhtmlx message or the new one. Either one returns the id of the message. The new parameter is called 'vue' (boolean). If this parameter is not specified, then the old handling applies.
If the message is created using dhtmlx, it cannot be updated later. This additional parameter has been introduced for backwards compatibility and might not be needed in the future. The default might become the VUE message.
Examples:
dhtmlx message: akioma.notification({text: 'text here'});
vue message: akioma.notification({text: 'text here', vue: true});
Update Messages
For message updates from the frontend, we have the following functions in the NotificationMessage: updateVueNotification
and removeVueNotification
.
These can be called using: akioma.NotificationMessage.updateVueNotification
and akioma.NotificationMessage.removeVueNotification
.
We also added those two new methods for update/delete in the Message.ts
, so they can also be called from CLAPI. Also, the message function from CLAPI now returns the id of the message.
Backend
Notification messages can also be created/updated from the backend. This is done through the UIConnector class. Here, we have following methods: showMessage, updateMessage and removeMessage. ShowMessage also has some overloaded methods.
Examples:
oUiConnector = NEW UIconnector().
oUiConnector:showMessage(/*parameters here*/).
UIConnectorSamplesDialog
In order to make it easier to test, you can navigate to the SamplesDesktop and open the UIConnectorSamplesDialog.
Here you can create/update/delete VUE messages with the specified parameters. In order to make it easier to test it, you can also specify a message id.
Back to Documentation
Back to Home Page