Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When does ProgrammaticChange fire?
Message
 
To
16/09/2002 18:00:46
Irv Adams
MSC Managed Care, Inc.
Florida, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00700846
Message ID:
00701119
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
Irv, I have two remarks that might help a bit :

Firstly, I use it all the time, and it just should work. But, concentrate on adjusting the ControlSource of the control or (I think Nancy said it) do it via THIS.Value. I think that there is a chance that your TableRevert isn't (at some point) bound to the control. If that's the case, you could try to perform an RLock() (and Unlock) to trigger things. Or, unbind the thing a bit by having a variable in between (so, the ControlSource is the variable, and the variable is explicitly assigned the value of the table -> leads to the more easy THIS.Value = ...).
Note that you also could be dealing with the ProgrammaticChange already not firing on the way to page 2. Hence, internally VFP might think it's still on 1, hence changing it back to 1 won't do anything.

Secondly, not all controls work properly (I'm talking VFP5 now). As I recall, the Combobox is not one of them (I think it is the checkbox giving probs).

Further, be sure that event processing is in effect, and maybe look at _VFP.AutoYield.

Lastly, you could apply the stupid trick of Keyboarding the pagenumber in the Combobox, and then let the InteractiveChange fire. But first check whether that works by normal entering via the keyboard. So, if THAT doesn't work already (InteractiveChange), you have some other kind of problem. This just should work.

HTH,
Peter


>Thanks for your response, Nancy, this is the scenario:
>
>- I have my custom Nav bar with Add,Save,Revert, etc. buttons on this Form.
>
>- The form has a combobox where the User dictates which Page of a Pageframe is currently active.
>
>- The Buffering is Table/Optimistic
>
>- Now let's say originally the Combo had Page1 as the choice. Now the User chooses Page 2, then changes their mind. They Click my Revert button and it does its thing correctly, changing their choice back to 1...
>
>- Trouble is although I have code in Programmatic/Interactive change of this Combobox the TableRevert() doesn't make it fire...maybe because it's being changed back to what it was so it really "didn't" change?
>
>I can force this event via clicking/tabbing out of the Combobox (Lostfocus fires it also), but I was just curious about the behavior...
>
>Thanks for your input.
>
>>Irv-
>>
>>I was going to reply with an example using EventTracking, but the real question seems to a little different.
>>
>>ProgrammaticChange occurs when your code directly changes the value. I.e. this.value = someNewValue. InteractiveChange fires when the user makes a change.
>>
>>You don't say what it is you need to do when the table is reverted, and that would make a difference. But it sounds like you would be better served by having a custom method that does whatever it is you need done, that can be called when it needs to be done. So, when you do a TableRevert, you'd also call this method. If programmaticchanges should fire the method, call it there, also. And so on.
>>
>>Does that help?
>>
>>>Thanks for your response, Victor.
>>>
>>>I have code in the Programmatic change,Interactive change and Lostfocus Events, actually, but it still doesn't fire on Tablerevert() until I visit (Setfocus) and leave (Lostfocus)...interesting...
>>>
>>>
>>>>It's probably the interactivechange() event that you want....I'm not positive but I think the Programmatic Change event only runs if you specificly change the values in the controls.... so you'd have to say something like txtbox.value = 'blah blah'...then it will run. Someone correct me if I'm wrong on this please...
>>>>
>>>>
>>>>>Hello Everyone:
>>>>>
>>>>>VFP 6.0 SP5; I do a Revert on a table followed by a Refresh(). This changes the value(s) in various txtBoxes, Combos, etc. on my Form to what they previously were, as expected.
>>>>>
>>>>>However, I thought this should cause the Programmatic Change event to fire for the appropiate Control(s); it doesn't seem to, any enlightenment?
>>>>>
>>>>>TIA !
Previous
Reply
Map
View

Click here to load this message in the networking platform