Let’s say the error does not just come up. But if I try to access solutionModel - that’s what I get: “Error during evaluation:ReferenceError: "solutionModel" is not defined.”
There are other places where we remove forms from history but nothing like this happens. Is this some sort of Servoy bug?
This code:```
history.removeForm(controller.getName());
Since Servoy 5.0 it is not necessary anymore to remove forms from the history to make changes to them. Instead you have to call controller.recreateUI() at the end of your changes.
Having said that, the error you get should never happen. Does it give any more information in the log file?
Joas:
This code:```
history.removeForm(controller.getName());
Since Servoy 5.0 it is not necessary anymore to remove forms from the history to make changes to them. Instead you have to call controller.recreateUI() at the end of your changes.
Having said that, the error you get should never happen. Does it give any more information in the log file?
The history.removeForm always return false.
function assignDataSourceToForm(datasource){
var my_form = “myform”; // form is inside panel
if(history.removeForm(my_form) == false) {
application.output(“cannot remove form from history”);
}
var thisForm = solutionModel.getForm(my_form);
thisForm.dataSource = datasource;
forms[my_form].controller.recreateUI();
}
The recreateUI still does not work. The function is called onShow of the mainform.
recreateUI is about the UI (as the name tells you that)
But setting the datasource is the data layer of the form, then recreateUI doesn’t work because there is no change in the UI, just in the data
And for data you have to destroy and recreate the form. This can only be done in a none visible form that is not executing any methods.
jcompagner:
recreateUI is about the UI (as the name tells you that)
But setting the datasource is the data layer of the form, then recreateUI doesn’t work because there is no change in the UI, just in the data
And for data you have to destroy and recreate the form. This can only be done in a none visible form that is not executing any methods.
I am lost. Can you guide me? Do you mean I need to create another form that will call removeForm then do the changes in data and call show?