public String getErrMessage() {
return Console.MESSAGES.common_validation_notEmptyNoSpace();
}
};
final ComboBoxItem basedOnSelection = new ComboBoxItem("based-on", Console.CONSTANTS.common_label_basedOn());
String[] exists = new String[existing.size()];
int i=0;
for(ServerGroupRecord rec : existing)
{
exists[i] = rec.getGroupName();
i++;
}
basedOnSelection.setDefaultToFirstOption(true);
basedOnSelection.setValueMap(exists);
form.setFields(nameField, basedOnSelection);
DialogueOptions options = new DialogueOptions(
// save
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// merge base
ServerGroupRecord newGroup = form.getUpdatedEntity();
FormValidation validation = form.validate();
if(validation.hasErrors())
return;
ServerGroupRecord base = null;
for(ServerGroupRecord rec : existing)
{
if(rec.getGroupName().equals(basedOnSelection.getValue()))
{
base = rec;
break;
}
}