Unverified Commit acabffcf authored by Evan W. Patton's avatar Evan W. Patton Committed by GitHub

Show text validation errors if not in multiselect mode (#2133)

Change-Id: Iadbfae002175a409b928f5c7e705c85cdb70566d
parent 36139183
......@@ -763,6 +763,7 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
break;
}
}
newProperties.getProperty(name).getEditor().setMultiselectMode(true);
newProperties.getProperty(name).setValue(sharedValue);
}
selectedProperties = newProperties;
......
......@@ -14,6 +14,8 @@ import com.google.gwt.user.client.ui.Composite;
*/
public abstract class PropertyEditor extends Composite {
private boolean multiselectMode = false;
/**
* Property being edited by this editor.
*/
......@@ -46,4 +48,12 @@ public abstract class PropertyEditor extends Composite {
public void refresh() {
this.updateValue();
}
public void setMultiselectMode(boolean multiselect) {
multiselectMode = true;
}
public boolean inMultiselectMode() {
return multiselectMode;
}
}
......@@ -152,11 +152,13 @@ public class TextPropertyEditorBase extends PropertyEditor {
validate(text);
property.setValue(text);
} catch (InvalidTextException e) {
String error = e.getMessage();
if (error == null || error.isEmpty()) {
error = MESSAGES.malformedInputError();
if (!inMultiselectMode()) {
String error = e.getMessage();
if (error == null || error.isEmpty()) {
error = MESSAGES.malformedInputError();
}
Window.alert(error);
}
Window.alert(error);
updateValue(); // Restore previous property value.
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment