rossent:
rgansevles:
Rossen,
Can you show a code snippet?
Rob
Hi Rob - take a look at this case: https://support.servoy.com/browse/SVY-2400
CORRECTION: The issue as described above is invalid and can be closed. The root cause of the problem turned out to be some change in the way the controller.loadRecords() method calls are handled in 6.1RC3. Here are the details:
Because the Servoy forms currently do not expose an event callback for the case when their foundset is changed after a call to controller.loadRecords(relation_or_foundset), we have a “wrapper” method in our base form which internally calls controller.loadRecords() but also performs some other UI updates and notifications. Our “wrapper” method is like this:
/**
* This is a wrapper around the controller.loadRecords method (check its documentation for params info).
* It should be used instead of calling the form's controller directly to make sure that the form
* updates correctly the data context of any other forms hosted on it.
*
* @param {JSFoundset|JSDataSet|Number|UUID|String} [data]
* @param {Array} [queryArgumentsArray] - optional, should be used only when the specified data is a query string
* @return {Boolean}
* @properties={typeid:24,uuid:"95D933E7-A20E-484C-A6B3-65D0244EAEE8"}
*/
function controllerLoadRecords(data, queryArgumentsArray)
{
var res = controller.loadRecords(data, queryArgumentsArray);
//invoke the notification to allow any extending forms to update their state using the new data context
dataContextChanged();
//now refresh the UI
updateUserInterface();
return res;
}
This code works correctly without failing in 6.0.6
However in 6.1b3, the line:
var res = controller.loadRecords(data, queryArgumentsArray);
throws the described exception even when the “wrapper” is called passing only the first argument like this:
forms.someForm.controllerLoadRecords(some_self_relation)
After changing the code of our “wrapper” method to:
function controllerLoadRecords(data, queryArgumentsArray)
{
var res = false;
if(queryArgumentsArray == undefined)
{
if(data == undefined)
{
res = controller.loadRecords();
}
else
{
res = controller.loadRecords(data);
}
}
else
{
res = controller.loadRecords(data, queryArgumentsArray);
}
//invoke the notification to allow any extending forms to update their state using the new data context
dataContextChanged();
//now refresh the UI
updateUserInterface();
return res;
}
the issue is resolved.
In other words, there is a change in behavior between 6.0.6 and 6.1b3 which results in Servoy choosing a different overload for the method controller.loadRecords() even though we still were passing the same arguments. Not sure if this is a desired behavior or some side effect which merits a separate case.