For a complete overview of everything new and improved in Servoy 6.0 see New in this release.
The following notable additions and changes were made in RC4:
sDocID:String, [beta:sTemplateID]:String}} oArg
sDocID:String, sTemplateID:String=}} oArg
A change was made to the state of the Renderable object that gets passed into the onRender event handler. It will now have the actual runtime state, including changes made in the previous onRender cycle, whereas before it would be the designtime state. "State" refers to the values of the properties of the Renderable object that can be set in the onRender event, like the fgcolor, bgcolor or font
This change was made to simplify the programming model: any changes made to elements through the scripting layer would previously be undone by the onRender event, as the onRender event took the designtime state as baseline for the rendering. Persisting the scripted changes all the way through an onRender event would require a lot of code. Basically the developer would have to pay very good attentions when adding onRender event handlers, because they could interfere with changes made to the UI thorugh business logic.
In order to separate these concerns, the baseline for the rendering in the new approach is the actual runtime state of the element. So if business logic has changes the bgcolor property of the element, the updated bgcolor value will be the value of the bgcolor inside the onRender event and if not further altered by the onRender logic, the element will display with the bgcolor value as it was set in the business logic. (prior to this behavior change the onRender logic would receive the designtime bgcolor value and the element would render with that value (unless otherwise specified inside the onRender event handler), basically overriding/undoing the scripted change to the bgcolor value).
The new approach does mean that in the onRender logic, both states of a property need to be handled. This means that if the onRender is used to set the fgcolor of a field depending if the dataprovider's value is negative or not, the fgcolor needs to be explicitly set for both negative and positive numbers. When the same foreground property is also set in scripting and should overrule the onRender, the developer needs to take care of this inside the onRender logic: