[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Data event of TableView


Hi all,

I have this form with 2 TableViews, besides each other.

The left TableViewL holds Article number, description, current supply, minimal supply, recommended refill (= minimal supply - current supply if positive, else 0).

The right TableViewR holds article number and recommeded refill.

User only needs to click a transfer button to add the recommended refill to current supply and form closes. This has been working like this since I guess 2012 or 2013 (originally coded in Gambas 3.6.2)

On request of some users, I build a button to set TableViewR recommendations to 0, as sometimes users want to divert from the recommendations because of changed circumstances that need human insight. This new button works fine.

The Data event of TableViewL does the recommendations or sets them to 0. I use a private variable array $aRecommend to store either the recommendation or 0. So, the button to set to 0 triggers the TableViewL data event to set the recommendations in TableViewR to 0 (ZERO) using aRecommend. If user now enters values to TableViewR and moves the mouse over TableViewL the data event of TableViewL is triggered and sets all recommendations in TableViewR to 0 again (as that is what it is coded to do), to great frustration of user.

Only way to prevent is NOT moving the mouse over the TableViewL, but that is no solution for end users. I tried to disable the TableViewL after the recommendations are set to 0 by user in TableViewR, but moving the mouse over the disabled TableViewL still triggers Data event and next sets TableViewR back to 0 and removes user input. Only if the mouse is moved over TableViewL and back to TableViewR the data is set back to zero, moving outside TableViewR elsewhere and back doesn't change the user input.
My question is simple: Is it possible to prevent the Data event of a TableView from triggering, once it has done his job and NO new data is read into it?

I have no example project as this is part of a large project and all of the above is linked to data in mariadb databases on the Debian servers.

gbWilly

[Gambas3 for Debian](https://gitlab.com/gbWilly/gambas3-debian-repository)

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

Follow-Ups:
Re: Data event of TableViewT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: Data event of TableViewBruce Steers <bsteers4@xxxxxxxxx>