Using the Alert widget, you can display information (Notifications, Advertisements, Confirmations, Error messages, Reminders), or request users to perform tasks (compliance tasks, make payments, provide feedback, etc.).
You can configure the alert in a way that the user must perform an action before proceeding to use the application (Modal). You can also use JavaScript functions to define the Yes or No buttons in an alert to allow the user to choose an action for the alert that appears. You can customize the skin, title, and icon for an alert.
The Alert widget capabilities can be broadly categorized into the following:
Properties | Description |
---|---|
alertTitle | Specifies the Title of the alert. |
message | Specifies the message description of the alert to be displayed. |
Properties | Description |
---|---|
retainContentAlignment | Helps to retain the content alignment of the widget while applying RTL. |
retainFlexPositionProperties | Helps to retain the left, right and padding properties while applying RTL. |
retainFlowHorizontalAlignment | Enables you to change the horizontal flow of the widget from left to right. |
Methods | Description |
---|---|
dismissAlert | Used to dismiss an alert. |
Events | Description |
---|---|
alertHandler | Specifies the JavaScript function that should get called when alert is dismissed either through "Yes" button or through "No" button. |
Properties | Description |
---|---|
accessibilityConfig | Enables you to control accessibility behavior and alternative text for the widget. |
alertIcon | Specifies the Icon to be displayed to visually indicate the type of alert. |
alertType | Specifies the Type of the alert window to be displayed. |
cursorType | Specifies the type of mouse pointer used. |
noLabel | Specifies the descriptive Text for the "No" label. |
yesLabel | Specifies the descriptive Text for the "Yes" label. |
textOverflow | Specifies whether text wrapping is enabled below the image when the text message is more than image height. |
You can use an Alert in many situations, some of them are:
Example
var alert = kony.ui.Alert(basicConfigs, pspConfigs);
pspConfigs is an object with platform specific configuration properties.
Note: In all native implementations alert is non blocking. Which means execution of logic (placed after the alert creation) will not wait for the alert confirmation but execution continues. In case of SPA, thin client platforms, it is always blocking the execution until user clicks either "yes" label button or "no" label button.
Note: Currently creating kony.ui.Alert itself will show the alert and end user has to respond to it. Alert Handle returned is not of any use but in future there is possibility of allowing the developers to show, dismiss the alert programmatically through this handle.
Note: The configuration properties should be passed only in the respective configuration objects otherwise they are ignored
Example
//Creating the alert with the alertIcon:"icon.png" var alertBasic = { message: "Kony Alert", alertIcon: "icon.png" }; var alertPSP = {}; var alert = kony.ui.Alert(alertBasic, alertPSP);
prem | Copyright © 2012 Kony, Inc. All rights reserved. |
prem | Copyright © 2012 Kony, Inc. All rights reserved. |