Binding Components

Posted by GregHiggins on 27-Oct-2008 13:11

Is it possible to bind a component to an object property?

If I have an UltraTextEditor, can I bind it to someObject:textProperty so that someObject:textProperty is automatically updated when the component gets filled in?

All Replies

Posted by Admin on 27-Oct-2008 15:18

Not using DataBinding as it is a bi-directional approach and someObject would need to be able to raise events as well (not supported by the ABL).

Most properties of .NET Controls offer a ...Changed event. So TextChanged in your case might work. This event is raised whenever the Text property is changed (user input, or assigned in code or even changed due to the change of a databound ABL field).

As you can have any number of event subscribers for a single event there should not be an issue, if you need the TextChanged event in another location for another purpose as well.

Posted by GregHiggins on 28-Oct-2008 06:41

Thank you!

I suspect that in my case, I won't want the property knowing about the input procedure so a direct subscription to a changed event would not be desirable, but I will keep this in mind for some mediating object.

Posted by Admin on 28-Oct-2008 07:18

I've been thinking about such a mediating object as well - but in the end, you need to be able to dynamically get/set a property or invoke a method.

.NET reflection works only against .NET types/interfaces. So that would be a desirable feature for a next release (besides events in classes).

This thread is closed