Michael: > 2. Just-in-time validation for every significant interaction
I'd think a loss of focus might be considered as a trigger for "significant interaction". Or perhaps you could give us an example of a use case in which it'll be insufficient? > when did a user significantly interact with the control? It depends on the application requirements. So, ultimately, the validation framework that the app developers are going to use must be flexible enough to handle all the cases. -andy From: Michael Strauß <michaelstr...@gmail.com> Date: Monday, March 27, 2023 at 10:19 To: Andy Goryachev <andy.goryac...@oracle.com> Cc: openjfx-dev <openjfx-dev@openjdk.org> Subject: [External] : Re: Allow input controls to indicate significant user interaction Hi Andy, thanks for your feedback. It's true that only an application knows which fields require feedback and which don't. That's why I don't propose to create a validation framework in the core platform. However, I don't think your solution addresses the point that I've raised. While using timers to trigger validation is certainly possible, it's not what I was describing; in fact, I would argue that this would be a very bad user experience in most cases. There are basically three kinds of validation semantics that are widely used: 1. Eager validation for every value change 2. Just-in-time validation for every significant interaction 3. Delayed validation at the time of form submission The first and third options have easy solutions in JavaFX applications, but the second option has no good solution. Sure, I can add event listeners to applicable controls and try to find out whether any particular sequence of key strokes or mouse events corresponds to a significant interaction. But that requires me to also consider many different ways in which controls can be significantly interacted with. For example, while I can type text into a text field, I can also paste text using my mouse. It would be very hard for me to detect all these interactions, and there is certainly no well-defined solution, as most aspects of control behavior are delegated to black-box skins in any case. There simply is no reliable way to answer the question that I need to have answered: when did a user significantly interact with the control? On Mon, Mar 27, 2023 at 6:46 PM Andy Goryachev <andy.goryac...@oracle.com> wrote: > > I think this functionality belongs to the application-level code, not in the > platform. It's the application that knows which parts of a form need the > visual feedback and which do not. In my opinion, there is no APIs that are > missing in order to implement a validation framework of any level of > complexity. > > > > Not responding to programmatic changes is easy: disable validation logic when > setting values. > > > > The validation and subsequent user feedback may happen at the time of form > submission, or as a result of a short timer expiring. The timer should be > restarted upon each update of the value properties being validated. > > > > In any case, this problem has a well-defined solution and, in my opinion, > does not require a change in the core platform. > > > > Cheers, > > -andy