Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bind Event to a Property
Message
From
24/07/2018 13:23:08
 
 
To
24/07/2018 10:52:16
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01661333
Message ID:
01661337
Views:
68
Events on properties: never done that... Still: Besides the usual supects [Tamar,Doug] you might google for Busti - Burkhard Stiller.
I worked with him sometimes, sometimes we were just on the same floor hacking when everybody else had left, sometimes we showed the stupid crazy bugs we found to each other [ALWAYS in other peoples code....], if it was our code, "of course" it was only ""Ey, there is a problem"... fun times ;-)

He took a definite liking to bindevent, structured his "dream framework" prominently around it but AFAIR also blogged about his adventures and findings in event land. He is a native german but I am pretty certain mails can be exchanged in English. If you do, say Hi from me ;-)

>I have searched the web for examples and explanations as to binding an event to a property. From the little I have found it tells me that an event can bond, but only when the property value changes (like Assign).

That was my gut feeling as well - no idea where I picked it up.

> But the event only is fired After the change occurs. This prevents any pre-change validation, or decision to stop the change from occurring. Also, the documents indicate that an Access like binding could be done, but I have found nothing explaining how. The big question is; does anyone have a complete instructions on how set the binding up, and how to determine (and set) the value of the property in the event?

I think vfp _access + _assign are miles above the typical getter/setter pattern found in Java and C#. Only code if something out of the ordinary warrants it - beautiful! Most, if not all behaviour should be doable/codeable via flags in such code.

If there really is a use case for bindevent on properties, my first try would be to code normal _access + _assign methods and try to bindevent those. If this works, fine - you are done, but I can imagine reasons for it not to work.

In that case, the pattern of

function propertyname_assign(tuValue)
= this.propertyname_assign_action(tuValue)

function propertyname_assign_action(tuValue)
this.propertyname_= m.tuValue

function propertyname_access()
return this.propertyname_access_action()

function propertyname_access_action()
return this.propertyname

should give you the option of calling bindevent on the propertyname_aXXss_action() methods

pls post your findings here

regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform