I have a SelectItem with an optionDataSource specified and I'm using setPickListFields to show a grid with multiple columns in the dropdown. I'd like to also setShowFilterEditor on the pick list grid but there doesn't seem to be a way to do that. Am I missing just it or is that not possible?
Announcement
Collapse
No announcement yet.
X
-
How can I access the underlying ListGrid for the PickList? For example, I'm not showing two columns in the PickList. One is an ID number and the other is a text field (name). If the user starts typing when the SelectItem has focus I want to showPicker() and then setFilterEditorCriteria() based on the character they just typed.
SelectItem.addKeyPressHandler() let's me take control at the appropriate event, but I don't see any way to setFilterEditorCriteria() on the pick list grid.
Comment
-
Getting very close. The only added complication is that I want the displayed value, once a selection has been made, to include both the ID and the name. I'm using setEditorValueFormatter() to do that
Code:hven.setEditorValueFormatter(new FormItemValueFormatter() { @Override public String formatValue(Object value, Record record, DynamicForm form, FormItem item) { Record selectedVendor = ((ComboBoxItem) item).getSelectedRecord(); if (selectedVendor==null) return null; else return selectedVendor.getAttribute("VNAM") + " (" + selectedVendor.getAttribute("VVEN") + ")"; } });
Is there some way for the value formatter to be temporarily disabled while a new selection is being made?
Comment
-
I now realize this has nothing to do with my EditorValueFormatter. The same thing happens without it. If the user types something that results in a single row being selected the display field from that row is put into the combo box, overlaying whatever the user was typing. So there is no opportunity for them to change what they typed. They have to clear the combo box and start over. Is there some way to prevent that from happening so that once the pickList is shown the user has to actually pick an item from the list, even if there is only one item in the list? If there is only one item in the list and they tab out of the field that item should be selected.
Comment
Comment