Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access/Assign methods for OTF properties
Message
From
20/08/2012 11:20:30
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01550780
Message ID:
01550801
Views:
103
>>>>>I like using access and assign methods because the consumer doesn't need to know about getter and setter methods.
>>>>>
>>>>>This is fine when a property exists on a form/class/etc.
>>>>>
>>>>>What about when the properties are created on-the-fly such as scatter name this.oData ?
>>>>>
>>>>>How would you go about adding access and assign methods to these properties?
>>>>
>>>>Use BindEvent() instead?
>>>>
>>>>Tamar
>>>
>>>I can't figure out how to have the _access and _assign methods available to bind to. Any thoughts on that?
>>
>>As I understand your situation, these methods must be "generic" methods which you bindevent to.
>
>Which isn't any better than using getters and setters.
>
>The goal is to bind a form control to the business object property. When that value changes, it should automatically call the relevant code in the business object. Without the property's _assign method, this is not possible without additional code that explicitly calls the setter method... unless I'm being dense (always a possibility :) )

Bind the relevant property to the code you want to run, using BindEvent(). (BindEvent() works for properties as well as methods.)

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform