Re: [Squirrel-sql-develop] Oppinions on data representation?
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Stephen S. <ss...@bj...> - 2002-11-20 18:46:37
|
> The second issue is this. If I am editing a nullable VARCHAR field and > I remove all of the characters from the visible display and save it, > does that mean: > - set the field to null, or > - put a zero-length string into the table? > My suggestion is that when you remove all the characters, that means a > zero-length string, and if you hit the delete key again, the field > toggles between a zero-length string an a <null>. Would that work for you? This seems mostly reasonable, although I'm not sure about toggling back to zero-length string once the field is null. Perhaps once the field is <null>, hitting delete should keep it <null>. If the user really wants a zero-length string, he can hit <space> <backspace>, right? I'm glad you're dealing with this issue. I can't recall using a DB editor that allowed the user to set a field to null easily -- I always ended up having to write a query. > That raises another thought, which is how to deal with that "Oh #*@%&" > moment just after you have accidentially touched a field that you did > not want to change and you don't remember how it looked originally. Ome > way might be to have a right-click menu item for "Restore original Cell > contents", but that may be hard to implement. Another approach could be > that when you delete everything from the cell and hit the delete key > again, the original contents are restored. With a nullable field, this > would cycle through the possibilities as follows: > - delete the data in the cell => the data is zero-length > - hitting delete key again => <Null> > - hitting delete key again => original contents of the field > Would this be ok? Hitting delete and seeing the original field contents restored would be confusing and nonstandard behavior. I think an undo mechanism is called for here. I assume that, now that you're going to make the contents display editable, you'll be adding an Edit menu with Cut, Copy, and Paste commands. How about including an Undo command that undoes the last edit? If there are operations that you don't want to support Undo for, then you could have Undo grayed out after the user performs one of those operations. For example, in MS Access when the user deletes a row, Access pops up a dialog warning that the operation cannot be undone. Stephen |