In my last post, I discussed how drop-down lists can give your users some flexibility while entering data. But what if you don’t want them to have flexibility?
Fear not, fascists! We can suck the democracy right out of that field control style.
Allow me to introduce the pop-up menu:
If you’ll check out the billableVsProBono field above, you’ll see that we have something similar to the drop-down list, but for one major difference. You can’t type anything. The only data you can enter in that field is one of the selections in the value list.
Now why would you want to do that? The billableVsProBono field is a perfect example. Our value list contains two values: Billable and Pro Bono.
We don’t want our users to be able to enter more values, a job is either billable, or it isn’t. When we do a search for our pro bono jobs, we want to get all of them, and not have to search for the ones that someone entered as “Free”, “Non-billable”, or “Bono Vox”.
So that’s it: Pop-up menus give your users the ability to select from a list of options, but not do any free entry. In a lot of cases, that may be exactly what you need.
Now the example I used here may not be ideal. If we only have two options, we might choose something like radio buttons instead (watch for that one in an upcoming post). Usually, pop-up menus would be used when there are more options. Let’s look at a different example that shows off another bit of pop-up menu coolness.
We’re going to create a pop-up menu for linking the client to this project. Create a new value list called ClientSelection_d, and we’ll define this to “Use values from field”.
As soon as you click on that option, the ‘Specify Fields for Value List “clientSelection_d”‘ dialog is invoked. Select the following options:
That’s cool. Even though we’re actually selecting the client’s primary key, we can display the company as well, so that we know which company we’re picking. That is something drop-down lists won’t do.
One step cooler, if you tick the checkbox for “Show values only from second field”, your users won’t even see the client’s primary keys. They just see the company names. That’s all they’re interested in anyhow, right?
So, let’s tick that box, and then keep hitting OK until we are back looking at our layout. Let’s go to Layout Mode, friends.
See that _kf_clientID field? We’re just going to work with the leftmost of the two of them that are side-by-side. Why did I have two there? That was me not planning out this whole series before creating the layout. I had thought I would demo something else there — decided not to.
So delete the right one, and let’s make that left one nice and wide. Now assign our new value list to it, with a pop-up menu, and go back into Browse Mode. Are you ready for this? You’re going to like it. Click on that field.
How cool is that? All you can see is the client company names. Now select one of them:
That’s one of the coolest things about pop-up menus. Even though the field contains the client’s primary key, you see the field that you have asked the value list to display.
- Pro bono is a latin term that has come into vogue since the advent of the modern lawyer drama on TV, meaning “for the public good” literally, but often meaning “free, but with the hope of getting us more work by looking like nice guys”.
- Does anyone else remember when U2’s Bono used to be called Bono Vox? I guess he decided at some point that Bono Vox sounded lame. He was half right; he should have stuck with Paul Hewson. Maybe some day he’ll change it to Bono Vox Mellencamp. [Disclaimer: Absolutely not a U2 or a John Mellencamp fan.]
- A huge caveat about this technique (Dude! More latin?). If that client gets removed from the value list (either by client record deletion, or some status trigger you may have set up), then the pop-up menu doesn’t have the client company name to display anymore, and you will be left with a number in that field. That could be confusing for your user.
- One technique for avoiding the issue in Note #3 would be to create a Picker Window. It would also help situations where you have a large number of clients to select from. Put a few hundred clients in the value list for a pop-up menu, and you’ll see how it quickly becomes unwieldy. At the end of this series, I may demonstrate the Picker technique.