I am running into a problem with the databaseManager.hasRecordChanges() nor recognizing a field change correctly.
Our solution has forms that the user opens and then uses to edit the data in the database. If a user opens a form, edits a field, and immediately clicks on the "red x" / closes the form, the onHide method will not recognize databaseManager.hasRecordChanges(foundset) to be true until the user actually leaves the field.
I've tried to set focus to another field, in the onHide event, prior to running the databaseManager.hasRecordChanges(foundset) which doesn't seem to work either.
- Code: Select all
/**
* onHide
*
* @param {JSEvent} event the event that triggered the action
*
* @properties={typeid:24,uuid:"1e789f14-b06e-4376-94db-c4374c4c6ce7"}
*/
function onHide(event)
{
controller.focusFirstField();
var lv_ok = databaseManager.hasRecordChanges(foundset); //this does not show correctly unless we place a break in our code (field loses focus)
if ( lv_ok != true)
{
var lv_msg = 'There are unsaved changes - either SAVE or ROLLBACK';
forms.graphics_template_dialog.setup_dialog('nothing','Unsaved Changes',lv_msg,'Ok'); //this just sets up a formwith a text box with the msg and two buttons. and shows it
}
return lv_ok;
}
Is there a way to recognize that the data hase been modified? we need to prompt the user that changes have been made and that they either need to save or rollback changes before they can proceed.
Is this related in anyway to the fix in 5.2.1 as mentioned in my other post http://www.servoy.com/forum/viewtopic.php?f=3&t=14624?
Thank you