Fog Creek Software
Discussion Board




2 entities, 1 form

Let's suppose that I have 2 entities on 1 form.  These entities form a 1 to many relationship.  I have to have these entities on the same form.  The problem is that I need unique "New, Save and Delete" operations for both entities.  Example: I can't have Alt+S mean "Save" for both entities.  This is a tricky situation and I'd like to not force the user to use the mouse to perform the operations.  I would also like not to have to split the entities into two separate forms.  Any suggestion would be appreciated.

Frustrated.
Monday, October 20, 2003

Well I think having "Alt-S" being potentially able to save either of the two clients would be slightly confusing for the user, expecially being on the one form. The irst thought would be "saves both" and this is a gap between what the user expects and what they must learn.

Maybe use a tabsheet with each client on a seperate sheet (slightly clearer but not really).

Or else, just let the clients make user of the tab keys, so they can tab to the 'save client1' button, and tab to the 'save client 2' button.

Just my thoughts.

Aussie Chick
Monday, October 20, 2003

A few different options... all of which are not outstanding, but it kinda depends how smart your operators are:

- use alt-s depending on what control (eg grid) on the form has focus. Could be confusing if it isn't obvious what control is selected

- map two sets of shortcuts (alt-1 for new object in entity 1, alt-2 for new in entity 2 etc). Alternatively alt-s for one entity, control-alt-s for the other.

- Hit alt-n, alt-s etc opens up a little dialog asking which entity you wish to modify. Within this dialog you can respond to another keypress. Eg alt-N to bring up dialog then just '1' key for entity 1, or '2' for entity 2.

This last option is probably the best that is at least a little consistent with other Windows GUIs.

PDF
Monday, October 20, 2003

I'm assuming you have something akin to "Customer" and "Order" entities.  Not that those are what you are talking about, but just for the sake of example.

You may be able to silently save the "1" side of the relationship (i.e. Customer).  You would have to keep track of when an order is placed and when the customer entity has changed etc etc.  At any rate this would limit the key presses to Alt+S, Alt+N and Alt+D (or whatever you are using)

Advisor
Monday, October 20, 2003

My experience of this is when users click on save (or alt-s/whatever) they want -everything- saved.  If they're editing -new- 1-n data and select the save option for the n side, you're going to have to run the 1 side save anyway or your rules will be broken.

In cases like 1-n editing I personally find giving the users new and delete buttons (next to the relevant data) for both parts makes more sense.

ScottB
Tuesday, October 21, 2003

Have your single method of saving, but have the code decide the sane choice. 

Have the validation check the child members, if they and the parent are valid then save both after a confirmation dialog.  If only the parent is valid then save the parent silently and continue with the form at the same control so that it appears as if it were a dead key.  You could display in a non-annoying place a confirmation that the parent record had been saved.

Only have a single button marked 'Save' or 'Post' don't make the user decide, its not a decision they need to make.

Simon Lucy
Tuesday, October 21, 2003

I know in Access, it will automatically save the one-side if you change focus from it to the many-side. If there is a validation error it will return focus back to the one-side.

So if you duplicate that logic you only need one save button.

So if the focus is on the one-side and changes have been made - enable the save button and disable the many-side. Once saved re-enable the many-side.  Do the same for the many-side.

DJ
Tuesday, October 21, 2003

*  Recent Topics

*  Fog Creek Home