Hi,
The javadoc states that if you set rejectInvalidValueOnChange, you can revert to the previous value.
I don't see that happening?!? Did I forget something?
I have added a standalone test case.
SmartClient Version: SC_SNAPSHOT-2011-03-07/EVAL Deployment
I set an initial value on my comboBox (2 => Green). I type in purple and tab out.
The javadoc states that if you set rejectInvalidValueOnChange, you can revert to the previous value.
I don't see that happening?!? Did I forget something?
I have added a standalone test case.
SmartClient Version: SC_SNAPSHOT-2011-03-07/EVAL Deployment
I set an initial value on my comboBox (2 => Green). I type in purple and tab out.
Originally posted by javadoc
Code:
public class Standalone implements EntryPoint { private static Canvas masterPanel = null; 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.setName("test"); comboBox.setTitle("Select"); comboBox.setHint("<nobr>A ComboBox with styled entries</nobr>"); comboBox.setShowPickerIcon(true); comboBox.setAddUnknownValues(false); comboBox.setDefaultToFirstOption(false); comboBox.setCompleteOnTab(true); comboBox.setValidateOnChange(true); comboBox.setRejectInvalidValueOnChange(true); //set the initial value comboBox.setValue(2); 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(); } }); //the order list grid DynamicForm form = new DynamicForm(); form.setHeight(170); form.setWidth(500); form.setFields(comboBox); masterPanel.addChild(form); masterPanel.draw(); } }
Comment