I’m trying to understand property bindings in more detail. In particular I’m curious about the evaluation of property bindings on a component in a window when the window is first opened (not cached). Obviously each bound property will be evaluated in turn. But what if one particular property depends on another and that other property has not yet been evaluated?
I did a test. On a template I defined two properties - aName
and smName
. In a window I placed an instance of the template and I bound the value of aName
to the value of smName
using a property binding. I set the value of smName
to 'sm1'
. In the propertyChange event script of the template I have the following:
if event.propertyName == 'aName':
print 'aName changed', event.newValue, event.oldValue if event.oldValue else 'None'
if event.propertyName == 'smName':
print 'smName changed', event.newValue, event.oldValue if event.oldValue else 'None'
When the window is opened the output on the console is:
aName changed sm1 None
smName changed sm1 None
This leads me to believe that aName
is evaluated before smName
. But when aName
is evaluated smName
has no value (you can see it changed from None
to sm1
but not until after aName
was evaluated). So how does aName
get the value sm1
? Should it not get the value None
?
On a side note: when does the component get painted on the window? After all these bindings have been evaluated?