The checkbox “Requires Root Object” that is found on the ViewModel is there for a purpose. The purpose is to further state the intention of how the viewmodel should be used – and thus the system can warn you when you mistakenly break this intention.
The checkbox is not new – it has been there for more or less a full year. What is new from today is that we can further warn you about inconsistences in your model. The overall goal is that you will have a fully functional model that cannot be misinterpreted by the execution framework – and as such the system will do exactly what you intended on the first go.
So soften the blow you can turn this stricter evaluation on or off:
You are urged to turn it On and correct any problems it reports.
What it will do:
It will remove self and vCurrent_VMName variables from ViewModel root that has not checked the RequiresRootObject
First red arrow shows that the header has been updated to show that value of the RequiresRootObject (green arrow).
Since the RequiresRootObject is false – a new error is reported in the column SomeInt – since it is rooted in self – and we will not have a “self” when we do not have an object. In this case maybe we mean the SomeInt from the current row in the AllThing-grid – then use vCurrent_AllThing. In this scenarion “self” is always a mistake – and it is good that the static analysis of the model can give you this information directly.
If we “fix” the problem by setting RequiresRootObject to true – we do have access to self – but we would get another error:
This time it is the action that brings this viewmodel up – if the viewmodel should have a RootObject then the action must provide one.
You should never start/execute your model if you have errors in it. Every error that MDrivenDesigner reports is an inconsistency that you will need to resolve.