Fog Creek Software
Discussion Board




Need a better UI for master/detail tables

Reference two tables named Contractor and Trade where Contractor denotes a one-to-many to Trade. The Contractor table contains a number of fields like ContractorID, Company_Name, Address, City, State, Phone, etc.., whereas the detail table Trade has only three fields or ContractorID, Division, and Section,  and contains a maximum of one to three detail records for each record in the Contractor table. The main form for the Contractor table consists of a grid (read only) used for viewing and selecting records in the Contractor table, and allows the end user to add/edit records via a popup entry form. While I could easily add another grid to show the detail record/s for each Contractor record in the main form or, for that matter, use a page control with tabs (one for Contractor and one for Trade) to show the same relationship, I'd prefer something better to present this data to the end user. I've also thought about using one form grid based upon the Trade table using lookup fields to show a many-to-one relationship for the Contractor table but then I can no longer sort on the Contractor name field which is a lookup field in the Trade table. Any suggestions as to an alternative UI to better show this particular relationship while allowing the end user to add/edit records for each table is appreciated.

Marty Potokar
Sunday, November 24, 2002

A visual of it would be helpful

Anonymous
Sunday, November 24, 2002

sketch some alternatives out, show them to the (potential) users.  describe what is happening to the users, but DO NOT use the words "master", "detail" or "table". 

because the best UI depends upon who it is for.  a part-time receptionist, a techie or a "time-is-money" executive?

and once you've decided on the best UI for the target audience, build it - you mention being unable to sort on lookup fields.  well, buy another grid control.  or write one.  or decide that sorting on that field isn't worth the effort.  but don't choose the ui based on the tools available, choose the tools based on the ui required. 

unless it's just an app for yourself.  in which case, do what you want!

Baz
Monday, November 25, 2002

don't sweat the small stuff.

Alberto
Monday, November 25, 2002

The first question is the purpose of the form, and whether you actually have two Use Cases.

Show all Contractors of a particular Trade
Show all Trades of a particular Contractor

There are the other Use Cases of Create/Edit/Delete but for your question you need to decide which is the true case, and if both are required you really have two different forms.

Simon Lucy
Monday, November 25, 2002

Here is what I use on occasion.

I place a list box (or whatever you use for the grid on the left side of the screen).

When you move through the data, then you have a another grid/listbox or  what ever you use also on the right side of the screen. That way, the user can easily scroll with the arrows keys up down, and NOT have to "click" to open another screen.

Here is an example screens shot:

http://www.attcanada.net/~kallal.msn/test/gs1.gif

If I move up a few times with the arrow key, you get:

http://www.attcanada.net/~kallal.msn/test/gs2.gif

On the left is actually a listbox control. However, on right, I needed the list to be editable, and also to display a check box. Hence, I used a continuous  form (if you lucky to have those!). You can do the above by using two of your favorite grid controls.

Albert D. Kallal
Edmonton, Alberta Canada
kallal@msn.com

Albert D. Kallal
Monday, November 25, 2002

I do the same as Albert but top/bottom instead of left/right.  Master list at top, details at bottom.  Use a freeform style instead of grid for the detail.  This gives more room for the detail data and help differentiate between the two types of data being displayed on the screen.

CharlesC
Monday, November 25, 2002

Here's a small screenshot from an upcoming release. The master record is at the top, and when you press the + beside it, you get the child records. In theory you can go as deep as you'd like, but more than one level and it just gets confusing.

http://www.uil.net/images/masterdetail.jpg

Tim Sullivan
Monday, November 25, 2002

Thanks to all, especially Albert and Tim for the screen shots. Also, valid point made that the UI dictates the tools. Fortunately, I have the tools to simulate the screen shots and a third party control that I've been toying with that emulates Tim's. Didn't really consider or think about the side to side grid layout that Albert uses. Needless to say, different and much better as opposed to the customary top/bottom grid that most all demos use. I only wish that there was more of this out there for database programmers like myself who have to go it alone. Thanks again for the help.

Marty Potokar
Tuesday, November 26, 2002

I will also add that the whole process of doing a search, and viewing the results can be EASILY done via the keyboard.

The those above screen shots, the text typed was pr, and if there was NO matches, then the cursor stays in the search box. If there is a match, then I move the focus to the list on the left side. The user can then use up/down arrow keys to move (and view details that show on the right side). Note that if the user hits enter, then that customer record/form is displayed. Of course inside each customer is the details. However, the user can also hit the tab key, and the cursor moves from the left side list to the right side. At that point again the up/down arrow keys will move, and again enter will bring up the detail record.

What this means is the whole process of a search, and a browse via the arrow keys can be done, and both the customer main record, or the detail record can easily be brought up. Again, NO mouse is required. (of course use the mouse to click on, or select a record on either side of the screen does work). Also, of course a double click on either side will bring up the record in form view.

I think it is very important to make these types of tasks very fluid, and not have to switch between keyboard and mouse to select a record. The whole process from start (the search) to finish (selection of record) should be nice simple keyboard sequence, and not some dance between the mouse and the keyboard..

Albert D. Kallal
Edmonton, Alberta Canada
Kallal@msn.com

Albert D. Kallal
Tuesday, November 26, 2002

*  Recent Topics

*  Fog Creek Home