Hi,
When the user clicks on a comboBox (focusEvent), the dropdown list should already be shown (=requirement). However, when doing this, the corresponding value is not selected in the dropdown list?
I have added a standalone test case, because I somewhat assumed that this would be normal behavior.
After some more investigation, I discovered that it's the ComboBoxItem that is not doing this, but the SelectItem is doing this same functionality just fine?
The issue can be reproduced via the showcase as well:
http://www.smartclient.com/smartgwt/...bobox_category
Select "Giraffe" in the combobox. Select "Japan" in the selectItem. When clicking on the pickerIcon of the combobox again, the first item ("Cat") is selected in the list, instead of the previously chosen value "Giraffe". When clicking on the dropdown of the selectItem, "Japan" is selected in the list (as expected).
Could you please advice?
Regards,
Bart
When the user clicks on a comboBox (focusEvent), the dropdown list should already be shown (=requirement). However, when doing this, the corresponding value is not selected in the dropdown list?
I have added a standalone test case, because I somewhat assumed that this would be normal behavior.
After some more investigation, I discovered that it's the ComboBoxItem that is not doing this, but the SelectItem is doing this same functionality just fine?
The issue can be reproduced via the showcase as well:
http://www.smartclient.com/smartgwt/...bobox_category
Select "Giraffe" in the combobox. Select "Japan" in the selectItem. When clicking on the pickerIcon of the combobox again, the first item ("Cat") is selected in the list, instead of the previously chosen value "Giraffe". When clicking on the dropdown of the selectItem, "Japan" is selected in the list (as expected).
Could you please advice?
Regards,
Bart
Code:
public class Standalone implements EntryPoint { /** * Container for either the login window or the workspace; */ private static Canvas masterPanel = null; /** * TEST CASE 5: auto select default value * * * @sofhistory * 08-03-2011 bade initial version * * @see com.google.gwt.core.client.EntryPoint#onModuleLoad() * */ public void onModuleLoad() { //masterPanel should be a Layout masterPanel = new Canvas(); masterPanel.setHeight100(); masterPanel.setWidth100(); masterPanel.setStyleName("pageBackground"); //background style from skin ComboBoxItem comboBox = new ComboBoxItem(); comboBox.setTitle("Select"); comboBox.setHint("<nobr>A ComboBox with styled entries</nobr>"); //when not focused, don't show picker icon comboBox.setShowPickerIcon(true); comboBox.setAddUnknownValues(false); comboBox.setDefaultToFirstOption(false); comboBox.setCompleteOnTab(true); LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>(); valueMap.put("1", "Red"); valueMap.put("2", "Green"); valueMap.put("3", "Blue"); comboBox.setValueMap(valueMap); comboBox.addFocusHandler(new FocusHandler() { public void onFocus(FocusEvent event) { event.getItem().showPicker(); } }); comboBox.setValue(2); //the order list grid DynamicForm form = new DynamicForm(); form.setHeight(170); form.setWidth(500); form.setFields(comboBox); masterPanel.addChild(form); masterPanel.draw(); } }
Comment