Currently, Servoy offers the combobox and the type ahead as solutions to being able to choose a value from a list.
FileMaker has a field format called Pop-up List that allows me to click on the field and if the list is longer that a certain number of items, a scrollbar is provided. I don’t have to type-ahead to activate the list, simply click and it pops open.
Servoy’s ComboBox is much like FMPs Pop-up Menu where you can click for a list, but the field looks like a pop-up item, not a text field. I like the Pop-up List in FMP because the look fits with other fields in my solution and I can use my mouse to click, scroll through my options and then pick one. Is there something I am missing in Servoy?
FYI the same principle applies to applying the calendar format to a field. The user is prevented from typing into the field, but the date picker still pops up.
Learned this recently while helping a customer, and it saved them a lot of grief.
I am using a Type Ahead field, but I want to just click on the field and get a list of all of the possibilities. Furthermore, I want to be able to click on the field and change it at will. When I first click on a blank field, it pops open the list, but when I go back, it assumes I want to edit the information in the field.
If I make the field non-editable, if there is something in the field, it does not open a list. On a blank field, as a non-editable field, it does nothing when I click on it.
Can I write something that forces the list to open upon clicking the field? Is that really the best way to address this? Do you think V3 would add a new field type option?
alassiter:
Can I write something that forces the list to open upon clicking the field? Is that really the best way to address this? Do you think V3 would add a new field type option?
Yes, you can attach a value list to a default text field. And then use the following global method to force the list to open every time:
var trigger = application.getMethodTriggerElementName();
var formName = application.getMethodTriggerFormName();
var elementName = 'fld_' + trigger.substr(4);
var fieldName = trigger.substr(4);
forms[formName][fieldName] = null;
forms[formName].elements[elementName].requestFocus();
This code works with the following naming convention:
column name = category
field name = fld_category
btn name = btn_category
In my case, I have a triangle (the button object) on the right edge of the field that you click to drop down the field list. But the code will also work if you put it on the onFocusGained event of the field. Gotta love a good naming convention
Thanks for the great tip. I like the way this works. With a Combobox, only the first character of each item in the value list is relevant when typing.
Aborginal
Australia
Brazil
China
Other
Typing ABO in a combo jumps to Other
Typing ABO in a typeahead sticks with aboriginal, which to my mind is more intuitive in many situations.
Typing AU doesn’t jump to Australia in a combo, but does in a typeahead.
One question, is there a simple way to give the field the APPEARANCE of a non-editable combobox (ie like a button in Kunststoff LAF). Then it would be PERFECT as it would visually match other combos.