Allow input controls to indicate significant user interaction
Michael Strauß
michaelstrau2 at gmail.com
Mon Mar 27 17:18:43 UTC 2023
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.goryachev at 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
More information about the openjfx-dev
mailing list