Reputation: 185
I need to display an alert on the xpages application. The condition is that if the entered value exceeds a percentage in relation to a value from the previous month the alert message is displayed. What would be the best way to implement this functionality? The component where the value is entered is a dojo number text box.
Should I treat the alert on the button where I submit to xpage? I thought that in the button code I could have two action groups, one that would remain as it currently stands, in which case the value would not exceed the percentage. In the other group of actions, for when the value exceeds the percentage, it would display a dialog stating that the percentage was exceeded and if the user would like to continue through an ok button, or correct the value through a cancel button. On the ok button, the same actions from the previous group would be inserted. Would these actions work in the context of the dialog box, correctly saving the datasource? Am I on the right track, or is there another simpler way to implement this alert, for example, when typing the value already display the alert?
It is important to point out that this is only an alert and not a validation that prevents the user from submitting to xpage.
Grateful!
Marcus.
Upvotes: 0
Views: 199
Reputation: 1503
You could test the value in the onChange event of the input control. Your alert could use Boot Alerts to display an alert that the user would see in the browser.https://xpage.me/2015/02/10/boot-your-alerts-in-the-with-bootalert/ or Growl http://elstarit.nl/2015/02/20/my-taken-on-a-multi-growl-message-phaselistner-for-xpages/
Upvotes: 1