Multiple Selection List: When One is Not Enough

When you add or edit data with DbEasy using the dynamic editor form it will automatically create the input controls you need to link data between two tables. Tables can have two types of links:

  • One-to-many
  • Many-to-many

An example of a one-to-many link is Employees and Departments. An Employee belongs to one Department. A Department has many Employees. The usual way that DbEasy implements this is with a drop-down list. When you are on the Employee editor form you will see a drop-down list for Department. When you click the drop-down you will see a list of all the departments: Marketing, HR, Facilities, Customer Service, IT, etc. When you select one then you will have created a link between that employee and the Department table.

An example of a many-to-many link is Students and Classes. A Student can have more than one Class and a Class will have more than one student. Another example is the Ageless Outings website. Ageless Outings is a guidebook of day trips within the greater Denver region. Each trip has a Destination. Each Destination can have one or more Restaurants nearby. A restaurant can be near more than one destination.

For the many-to-many link between Ageless Outings Destinations and Restaurants the DbEasy multi-select list provides the user interface for selecting multiple Restaurants for each Destination and vice-versa. When you log into DbEasy you will see that the main menu provides access to three main entities: City, Destination, and Restaurant.

Destinations and Restaurants have a many-to-many relationship.

A Destination can have one or more Restaurants associated with it. A Restaurant can be associated with one or more Destinations.

When you are in the Destination editor you can scroll down to the bottom and see the list of Restaurants

There is currently one restaurant selected, “Bridgewater Grill.” If you click anywhere on the button it will open the dropdown list. Notice the “Bridgewater Grill” is checked in the list.

If you click other Restaurants then the multi-select dropdown will add them to the list of selected restaurants.

The multi-select also has a search box that lets you narrow down the list by typing. As you type it will filter the list to just those values that contain what you type. So in our Restaurant example if you type “Br” the results will include “BJ’s Brewhouse,” “Bridgewater Grill.” and “The Olive Branch.”

You also have buttons that let you check all the items, “Select All,” remove all items from the list, “Select None,” or go back to what was selected before you clicked the dropdown, “Reset.”

The multi-select control in DbEasy makes it easy to enter data when your database has a many-to-many relationship.

Leave a Reply

Your email address will not be published. Required fields are marked *