apandey1
6 Jan 2012, 8:40 AM
I have issue in validating simplecombobox
Code for comboBox is :
SimpleComboBox<String> tf = new SimpleComboBox<String>();
tf.setStyleName("configSettingsComboBox");
tf.setTypeAhead(true);
tf.setForceSelection(true);
tf.setEditable(true);
tf.setTriggerAction(TriggerAction.ALL);
tf.setValidateOnBlur(false);
We are adding empty string along with list of values to SimpleComboBox. Empty string allows user to select value by typing initial character. When submitting form, we check that combobox value is not empty string, else we set error message using
tf.forceInvalid("Value cannot be empty");
However we found that forceInvalid method is not working, also we tried custom validator , but it does not get triggered when empty value is set in SimpleComboBox.
Using setAllowBlank(false) for SimpleComboBox is also not validating when empty string is selected.
How do we validate SimpleComboBox for empty value.
Code for comboBox is :
SimpleComboBox<String> tf = new SimpleComboBox<String>();
tf.setStyleName("configSettingsComboBox");
tf.setTypeAhead(true);
tf.setForceSelection(true);
tf.setEditable(true);
tf.setTriggerAction(TriggerAction.ALL);
tf.setValidateOnBlur(false);
We are adding empty string along with list of values to SimpleComboBox. Empty string allows user to select value by typing initial character. When submitting form, we check that combobox value is not empty string, else we set error message using
tf.forceInvalid("Value cannot be empty");
However we found that forceInvalid method is not working, also we tried custom validator , but it does not get triggered when empty value is set in SimpleComboBox.
Using setAllowBlank(false) for SimpleComboBox is also not validating when empty string is selected.
How do we validate SimpleComboBox for empty value.