You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion is related to PR #186. 2014/01/22. It describes specifics about
the PR, things that led to the PR, and issues discovered while putting together
the PR. It is not fleshed out and undoubtedly incomplete. There may be follow on
comments and hopefully the community with offer insight.
SSCommon
There's final flag DISABLE_GENERAL_VALIDATION; when set, only
SSFormattedTextField gets a decorator.
At end of the file, read comments about decoration/validation.
New stuff
Interface Validator
App can set this for additional checks
SSComponentInterface.isDataValid() - default true
Indication of compenent valid, maybe only meaningful for SSFormattedTextField
Interface Decorator - draws visual indicator
Typically does Validator.validate() && SSComponent.isDataValid()
SSCommon handles Decorator and Validator
Validation points where data can be checked for validity
Group validation for multiple interacting components
UI/App choices
SQL exception handling
dialog (widely used in SwingSet (only way exception handled?))
error state
message attached to component
Focus change strategy in the face of errors
Lock to component (SSFormattedTextField is like this (more or less)).
Don't lock Mark any component with error.
This should probably be an App UI decision and consistent.
Decorator look&feel
When component change
Never gets here if SSFormattedTextField violation.
If validation check return then try to write to database
Other
If decorator/validator used on ordinary JTextField, and there's an error,
hitting next keeps the error focus on the next record. This may simply be
a bug; it might be a flaw somewhere.
There's PR #187, built on #186. It shows a 3rd party decoration/validation
infrastructure, SimpleValidation https://github.com/timboudreau/simplevalidation,
used with SwingSet; the swingset-demo/.../simpval directory has the beginnings
of utilities and helpers for using SimpleValidation.
Using this, each SSTextField can have it's own error message as a badge tool tip.
I can imagine that an SQL exception message is captured and associated with the
SSComponent.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This discussion is related to PR #186. 2014/01/22. It describes specifics about
the PR, things that led to the PR, and issues discovered while putting together
the PR. It is not fleshed out and undoubtedly incomplete. There may be follow on
comments and hopefully the community with offer insight.
SSCommon
SSFormattedTextField gets a decorator.
New stuff
App can set this for additional checks
Indication of compenent valid, maybe only meaningful for SSFormattedTextField
Typically does Validator.validate() && SSComponent.isDataValid()
Validation points where data can be checked for validity
UI/App choices
When component change
Never gets here if SSFormattedTextField violation.
If validation check return then try to write to database
Other
hitting next keeps the error focus on the next record. This may simply be
a bug; it might be a flaw somewhere.
There's PR #187, built on #186. It shows a 3rd party decoration/validation
infrastructure, SimpleValidation https://github.com/timboudreau/simplevalidation,
used with SwingSet; the swingset-demo/.../simpval directory has the beginnings
of utilities and helpers for using SimpleValidation.
Using this, each SSTextField can have it's own error message as a badge tool tip.
I can imagine that an SQL exception message is captured and associated with the
SSComponent.
Beta Was this translation helpful? Give feedback.
All reactions