Skip to main content

Comments on data entry

No replies
jancarel
Offline
Joined: 2004-03-11
Points: 0

As my data entry framework for an in-house legacy data front end was only half finished, I decided to try to build this based on the jndc code. The system is operational now with lots of rough edges to be cleaned up. Please find my comments below, in no particular order of importance.
I hope this will be of use.

1. A good date picker component is absolutely necessary. I have wondered for years why this was left out of swing. I would have given this more priority than color & font choosers. I plugged in a variant of JCalendar by Kai Toedter (www.toedter.com) patched to show week numbers.

2. The jndc library should cater for more data types out of the box, I experienced incompatibility as my data source furnished dates as java.sql.Date types, and integers as java.math.BigInteger types. My workaround was to plug in a conversion model between the form data model and my datasource data model which handles the type conversion to and fro; as patching the jndc library is not that straightforward.

3. I wonder whether the JSpinner component for numbers is the correct choice. As the code is built now, validation takes place within the spinner model, which means that the component will revert to its old value on losing focus without the binding border and info messages coming up. IMO the info icon should show up on all components (possibly with the exception of the checkbox).
A possibility could be to set the spinner model to accept all values between min_value and max_value. The metadata min and max values could then be taken up by a number validator, which could show appropriate messages.
Anyway, in the current implementation number data entry is not consistent with string data entry.
And by the way, jndc team, real world data entry involves a lot of numbers and not only strings...

4. I implemented LinkedEnumeratedMetaData as subclass of EnumeratedMetaData, as our system has so many lists of the type
1- box
2- bag
3- bundle
where data is stored as numbers or abbreviations and the user interface shows the explanatory strings. Very little work, good result. The MetaData concept is great.

5. Other threads have already complained about the limitations of JNForm. Obviously building a replacement is trivial. My gripe however about JNForm is that the reset and submit buttons are always enabled. For good user experience the reset button should only be enabled when data has actually been modified. The submit button should be enabled only when data has been modified and the data is valid.

6. Extending the form factory to plug in custom components is feasible, the binding border should be made public though. Possibly the form factory should just be a container for three pluggable parts:
* component factory serving up the appropriate component per data type.
* binding border manager to add binding to the component. You could then choose to color the text red on errors, instead of drawing a red border.
* layout manager just taking care of the layout of the form.