Jon,
Has this issue been raised so it can be fixed in the next version of Verj ?
I tested this out on Chrome 73.0.3683.103, Firefox 66.0.3 and Edge 42.17134.1.0 and this issue only happens in Google Chrome.
My production server is currently on 5.5.0 and my Dev server is on 5.5.1 and both seem to have this problem.
I found a similar situation where if you call $eb.getField("FIELDNAME") while stopped at a debugger breakpoint, it also returns undefined. Calling $eb.getField("FIELDNAME") when not stopped at a debugging breakpoint correctly returns an object.
This bug is causing us a lot of issues because most of my applications open up in a popup window which displays a form where you can edit an individual record. When you save the record and close the popup window, I have this jQuery script that runs in the popup window to trap the window unload event:
Code: Select all
// This script will execute when a popup window is closed and will call the appropriate function in REFRESH_FUNCTIONS to refresh the table in a parent window
$(document).ready(function () {
$(window).on("beforeunload", function(e) {
// If the parent window doesn't have a refreshTables function, it means REFRESH_FUNCTIONS client script is not attached to it so do not continue
if ( typeof(window.opener.refreshTables) != "function" ) {
return;
}
// This line is failing because of the issue with $eb.getFieldValue's context when debugging
var refreshNeeded=$eb.getField("REFRESHNEEDED").getValue();
if (refreshNeeded == 1) {
window.opener.refreshTables($eb.getField("REFRESHTABLE").getValue());
}
});
});
The parent window that opened the popup has this script attached:
Code: Select all
function refreshTables(refreshTable) {
if ( refreshTable == "HR_CALENDAR" ) {
var param=[parseInt($('#MonthSelect').val())-1,parseInt($('#YearSelect').val())];
$eb.executeFunction("refreshCalendar",param,true);
} else {
$eb.executeFunction("refreshEbaseTables",refreshTable,true,false);
}
}
which in turn calls the server side function refreshEbaseTables() which calls fetchTable for the table name passed as a parameter.
This way, when you save a record in the popup window, the parent window is automatically refreshed with the latest data. This bug is causing this logic to fail in the popup window for the line that I highlighted above.