4GL Patterns #1 – Select or Add
A common pattern found in database applications is the “Select or Add” pattern.
The pattern allows a user to either
- select an existing item (usually a foreign key), or
- to add a new item to the foreign key table, then refresh the combo box, and setting the item to the newly added one
Example
The following is a screenshot from Django’s auto-generated administration screens.
The user is presented with a drop-down box, or a plus icon to add new items to the drop-down list.
The following shows an alternate approach, where an “Add” keyword is added to the bottom of a pick list. This approach can be harder to internationalize.
Other notes
When a new Create Data form is shown to the user, while it may be convenient to make this form modal, so that the parent form can refresh it’s pick list. It may be better to present a non-modal interface so that the user is not blocked from performing other work. This can be done by providing a callback whenever an item is created.
Related Ideas
- Stable foreign keys
- Caching
About this entry
You’re currently reading “ 4GL Patterns #1 – Select or Add ,” an entry on Chui's Counterpoint
- Published:
- 9.17.08 / 9pm
- Category:
- database, Thinking IT


3 Comments
Jump to comment form | comments rss [?] | trackback uri [?]