Display an xpage alert when a value is exceeded - dojo

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.

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/

Related

Check some field before opening confirmation box in ODOO

I want to check that if some fields in the form view has been checked or not. If they have been checked then show a confirmation message and if not then a error message saying that those fields must be checked. For this functionality I have created a button which calls a specific function in the model. The button has also attribute confirm which enables the confirmation pop up box. But all the time it first opens the confirmation message and then the checking for the fields. I want to have the other way around how to achieve this. Please help.

Apex 5.0: Show a progress bar while Database Action is performed

Implementing a Waitbar or Progressbar
In my Apex 5.0 application I have a SQL Update which is taking very long to process, and I want to implement an indicator to show that it is still running, so that the user won't start the action again.
A progressbar would do the trick, can anyone suggest a way of doing so?
(plugins aren't possible)
Just Change the action of your SUBMIT button to Dyanamic Action
On dynamic action choose ON CLICK as Event .Choose Button for Selection Type and Choose Name of your submit Button to Button
Then on Action, Choose SUBMIT PAGE
Then on Request /Button Name, put your SUBMIT button's Name.
Then set SHOW PROCESSING to YES
Use the JavaScript function apex.sumbit to submit the page and include the showWait option to display the progress bar. Here is an example...
apex.submit({ request:"DELETE", set:{"P1_DEPTNO":10, "P1_EMPNO":5433}, showWait:true});

YUI3: Re-fire an event that I stopped from propagating?

I've got a form within a tabview with input fields. If the user changes the input fields, doesn't save, and then tries to change the tab I want to ask them if they want to save changes before the tab is changed. I'm preventing the tab-change from occurring using e.stopPropagation(). I then prompt the user to ask if they want to save their changes, discard them, or cancel. If the user chooses save or cancel I'd like to perform the operation and then change them over to the tab they requested.
Is there a way for me to re-fire the event? Or will I have to extract what tab they were requesting from the event and then manually change the active tab?
I would think that the best way to tackle this issue would be to select the tab programmatically instead of trying to "re-fire" the event somehow.
To select a tab programmatically with tabView, you need to use the selectChild(index) method.

How to clear textbox value?

In my CustomUI I am trying to validate the logon service account by entering the username and password. The Test button will validate the credentials. If it is an invalid account, it will show a spawndialog with an error, and on clicking will return to the same CustomUI. While returning back the username and password textbox value should be empty. What is the best way to clear out the textbox values? I tried by setting the property of the textbox value to empty, but the installer get failed.
On the close button control of your modal dialog you can put a set property control event that sets those properties back to empty. ( {} means empty in MSI ) Be sure to get the controlevent order correct so that the properties get set before the dialog is closed.
But, I'm not sure this will work. I'm not positive that the original dialog will refresh that data correctly. There are certain limitations of MSI UI and this might be one of those cases. (I'd have to mock it up to confirm. )
If you do his this limitation, the workaround is to do a NewDialog instead of a SpawnDialog and on that dialog tell the user there is a problem and only offer them a back button to the previous dialog.

DevExpress VerticalGrid Validate event and behavior with RadioButton cell editors

I'm using the VerticalGrid in MultiRecordView. Its Validate event fires when the grid detects that a record that has been changed is losing focus. I'm writing data to the database from this event.
My users want to use the keyboard left/right arrow keys to move forwards and backwards through the recordset, so I trap those keys and set the FocusedRecord accordingly.
If one of the row editors is a RepositoryItemRadioButton, the Validate event doesn't always fire. The users will click on the radio-button value desired and then, before they click on another row in the record, they'll hit the arrow key to move to the next record. The change to the radio button group has not been detected by the grid in that sequence of events.
The radio button change is detected only when the button loses focus.
Is there a way to cause the vertical grid to recognize that a radio button editor has been changed and fire the Validate event, if the user doesn't give another row in the record the focus?
I thought EditValueChangedFiringMode property controlled that behavior, but setting it to Default or to Buffered does not have the desired effect.
Thanks