I have a checkbox in a grid. The column and the checkbox control source are both set to the same field in the table. The table is open in the data environment with BufferModeOverride set to 5, optimistic table buffering. If I put the TableUpdate command in the InteractiveChange method of the checkbox any change is not committed but if I put the identical code in a button instead then the change is committed. What am I doing wrong? :-(
John
John Weller 01380 723235 07976 393631
Without thinking too hard about this (<s>), is it possible in the InteractiveChange event the Valid has not yet fired, so the change to the Value of the bound control has not yet been written to the underlying source?
On Mon, Oct 23, 2017 at 4:10 PM, John Weller john@johnweller.co.uk wrote:
I have a checkbox in a grid. The column and the checkbox control source are both set to the same field in the table. The table is open in the data environment with BufferModeOverride set to 5, optimistic table buffering. If I put the TableUpdate command in the InteractiveChange method of the checkbox any change is not committed but if I put the identical code in a button instead then the change is committed. What am I doing wrong? :-(
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
Thanks Ted - I'll check that in the morning. It's 10pm here and my wife is getting grumpy :-)
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: 23 October 2017 21:18 To: profoxtech@leafe.com Subject: Re: Checkbox Problem
Without thinking too hard about this (<s>), is it possible in the InteractiveChange event the Valid has not yet fired, so the change to the Value of the bound control has not yet been written to the underlying source?
On Mon, Oct 23, 2017 at 4:10 PM, John Weller john@johnweller.co.uk wrote:
I have a checkbox in a grid. The column and the checkbox control source are both set to the same field in the table. The table is open in the data environment with BufferModeOverride set to 5, optimistic
table
buffering.
If I put the TableUpdate command in the InteractiveChange method of the checkbox any change is not committed but if I put the identical code in a button instead then the change is committed. What am I doing wrong? :-(
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
Uh oh - be careful - you don't want to get the Boss even More grumpy!!!
:-)
-K-
On 10/23/2017 4:54 PM, John Weller wrote:
Thanks Ted - I'll check that in the morning. It's 10pm here and my wife is getting grumpy :-)
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: 23 October 2017 21:18 To: profoxtech@leafe.com Subject: Re: Checkbox Problem
Without thinking too hard about this (<s>), is it possible in the InteractiveChange event the Valid has not yet fired, so the change to the Value of the bound control has not yet been written to the underlying source?
On Mon, Oct 23, 2017 at 4:10 PM, John Weller john@johnweller.co.uk wrote:
I have a checkbox in a grid. The column and the checkbox control source are both set to the same field in the table. The table is open in the data environment with BufferModeOverride set to 5, optimistic
table
buffering.
If I put the TableUpdate command in the InteractiveChange method of the checkbox any change is not committed but if I put the identical code in a button instead then the change is committed. What am I doing wrong? :-(
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
I put the code in the Valid and it worked like a charm! Thanks again Ted.
Regards
John
John Weller 01380 723235 07976 393631
Without thinking too hard about this (<s>), is it possible in the InteractiveChange event the Valid has not yet fired, so the change to the Value of the bound control has not yet been written to the underlying source?
On Tue, Oct 24, 2017 at 12:25 PM, John Weller john@johnweller.co.uk wrote:
I put the code in the Valid and it worked like a charm! Thanks again Ted.
Lucky guess. Glad it helped!
-- Ted Roche & Associates, LLC http://www.tedroche.com
On 2017-10-24 12:59, Ted Roche wrote:
On Tue, Oct 24, 2017 at 12:25 PM, John Weller john@johnweller.co.uk wrote:
I put the code in the Valid and it worked like a charm! Thanks again Ted.
Lucky guess. Glad it helped!
I've never liked putting any code in the InteractiveChange event. Last gig I had, they had done that and the results were very buggy/crappy. It's like they prefer action on every keystroke instead of waiting for the valid event. Sure, yeah, nice to have such "INSTANT" changes elsewhere but not worth the hassle as per my experience.
I use Valid and LostFocus far more frequently than InteractiveChange. When I do use InteractiveChange it is usually to activate/deactivate other form fields based on this.value. Usually no more than 2 or 3 lines of code at the most if I can help it and never while in a grid.
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Tuesday, October 24, 2017 12:52 PM To: profoxtech@leafe.com Subject: Re: Checkbox Problem
On 2017-10-24 12:59, Ted Roche wrote:
On Tue, Oct 24, 2017 at 12:25 PM, John Weller john@johnweller.co.uk wrote:
I put the code in the Valid and it worked like a charm! Thanks again Ted.
Lucky guess. Glad it helped!
I've never liked putting any code in the InteractiveChange event. Last gig I had, they had done that and the results were very buggy/crappy. It's like they prefer action on every keystroke instead of waiting for the valid event. Sure, yeah, nice to have such "INSTANT" changes elsewhere but not worth the hassle as per my experience.
[excessive quoting removed by server]
On 2017-10-24 15:34, Paul H. Tarver wrote:
I use Valid and LostFocus far more frequently than InteractiveChange. When I do use InteractiveChange it is usually to activate/deactivate other form fields based on this.value. Usually no more than 2 or 3 lines of code at the most if I can help it and never while in a grid.
The crazy code I had at the last gig was doing that crap in a grid. Ugh. So buggy. It didn't help that you had to debug maybe 13+ levels on stack due to gazillion layers on inheritance.
Maybe I'm just not "meta" enough, but as cool and useful as inheritance is, more than just a few levels deep makes my head swim. And, the older I get, the more I seem to be leaving breadcrumbs behind for me a follow a few years from now when I have to do updates.
Now that I think about it, I think I'm going to start leaving myself motivational statements in my comments. That way when I revisit code in the future, it will be like my younger self cheering on my older self.
Of course, if I start seeing messages from my older self in code I'm working on currently, I should probably seek help immediately. Right? :)
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of mbsoftwaresolutions@mbsoftwaresolutions.com Sent: Wednesday, October 25, 2017 4:55 AM To: profoxtech@leafe.com Subject: RE: Checkbox Problem
On 2017-10-24 15:34, Paul H. Tarver wrote:
I use Valid and LostFocus far more frequently than InteractiveChange. When I do use InteractiveChange it is usually to activate/deactivate other form fields based on this.value. Usually no more than 2 or 3 lines of code at the most if I can help it and never while in a grid.
The crazy code I had at the last gig was doing that crap in a grid. Ugh. So buggy. It didn't help that you had to debug maybe 13+ levels on stack due to gazillion layers on inheritance.
[excessive quoting removed by server]
No, you should just go out into the car park and make sure your De Lorean is still there :-)
John
John Weller 01380 723235 07976 393631
Now that I think about it, I think I'm going to start leaving myself
motivational
statements in my comments. That way when I revisit code in the future, it will be like my younger self cheering on my older self.
Of course, if I start seeing messages from my older self in code I'm
working
on currently, I should probably seek help immediately. Right? :)
LOL!
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of John Weller Sent: Wednesday, October 25, 2017 11:39 AM To: profoxtech@leafe.com Subject: RE: Checkbox Problem
No, you should just go out into the car park and make sure your De Lorean is still there :-)
John
John Weller 01380 723235 07976 393631
Now that I think about it, I think I'm going to start leaving myself
motivational
statements in my comments. That way when I revisit code in the future, it will be like my younger self cheering on my older self.
Of course, if I start seeing messages from my older self in code I'm
working
on currently, I should probably seek help immediately. Right? :)
[excessive quoting removed by server]
On 2017-10-25 12:11, Paul H. Tarver wrote:
Maybe I'm just not "meta" enough, but as cool and useful as inheritance is, more than just a few levels deep makes my head swim.
Tell me about it!!!! It was insane. Some genius (really, not sarcasm) developers there over the years but not something I enjoyed learning to work on, as I kept having to dive bazillion layers deep to understand. Great for them perhaps; shit for me.
And, the older I get, the more I seem to be leaving breadcrumbs behind for me a follow a few years from now when I have to do updates.
I do that all the time! I've got clients for nearly 15 years using the same apps I developed for them in 2003 and I find my dev notes very important and helpful when I have to come back and visit a section of code. I've always operated under the idea that you want to make it easy for the next guy (or yourself, as in my cases so far). Don't code in a way that the next guy will want to shoot you on sight.
Now that I think about it, I think I'm going to start leaving myself motivational statements in my comments. That way when I revisit code in the future, it will be like my younger self cheering on my older self.
YES!!! LOVE THAT!!!!!
Of course, if I start seeing messages from my older self in code I'm working on currently, I should probably seek help immediately. Right? :)
No, you should just look for Marty, Doc, and/or the Dolorean. http://www.imdb.com/title/tt0088763
On 2017-10-23 16:10, John Weller wrote:
I have a checkbox in a grid. The column and the checkbox control source are both set to the same field in the table. The table is open in the data environment with BufferModeOverride set to 5, optimistic table buffering. If I put the TableUpdate command in the InteractiveChange method of the checkbox any change is not committed but if I put the identical code in a button instead then the change is committed. What am I doing wrong? :-(
Hi John,
I'm betting Ted's right about the order of events firing...but I will say this is why I never liked editing in grids and dumped using buffered tables directly in the app; when I went to local views, so many problems disappeared. But to be fair, that was VFP6SP5 on a Novell network, which was known to be hinky.
--Mike
Hi Mike,
You will see from my reply to him that he was spot on (as always). My biggest problem is that I've not done any coding for 7 years apart from tweaking an existing app so have got very rusty :-)
John
John Weller 01380 723235 07976 393631
Hi John,
I'm betting Ted's right about the order of events firing...but I will say this is why I never liked editing in grids and dumped using buffered tables directly in the app; when I went to local views, so many problems disappeared. But to be fair, that was VFP6SP5 on a Novell network, which was known to be hinky.
--Mike