On Apr 24, 2007, at 10:44 PM, Carl Karsten wrote:

> DataSource="myObj" does not.  I don't get an error, until I type a  
> value and
> move focus to another object:
>
> Dabo Error Log: Tue Apr 24 21:08:54 2007: Could not bind to  
> 'myObj.MyProp2'
> Reason: 'NoneType' object has no attribute 'MyProp2'
>
> This seems odd.  myObj should be created and in scope, so why isn't  
> the
> conversion happening?

        The fact that this happens when you change the value should give you  
a clue. DataBinding is dynamic, and as a result is evaluated when it  
is used; otherwise, you'd get into the problem of the bound to object  
always needing to be instantiated first, etc.

        If you set DataSource to a string, it needs to be a string that can  
be dynamically evaluated. 'self', 'self.Form', and  
'self.Form.someRegID' are all references that are valid at any point  
in the object's life. We threw in the shortcuts of 'form' and 'app'  
cause we're lazy, and believe that so are most other programmers.

        If myObj exists at the time you are assigning the DataSource, then  
use the object reference, not a string containing a temporary name to  
that object.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to