Fixing: listBox with empty selection
This commit is contained in:
parent
588c5cd82b
commit
77010cc7d6
|
@ -309,11 +309,12 @@ public class MetaDataFieldSkeleton extends Composite{
|
|||
if(field.isMultiSelection())
|
||||
tempListBox.setTitle(TOOLTIP_MULTISELECTION);
|
||||
|
||||
// if it is not mandatory, add a disabled option
|
||||
if(!field.getMandatory()){
|
||||
// if it is not mandatory and not multi-selection, add a disabled option (placeholder)
|
||||
if(!field.getMandatory() && !field.isMultiSelection()){
|
||||
tempListBox.addItem("Select " + field.getFieldName());
|
||||
tempListBox.setSelectedValue("Select " + field.getFieldName());
|
||||
tempListBox.setValue(0, "");
|
||||
tempListBox.getElement().getElementsByTagName("option").getItem(0).setAttribute("disabled", "disabled");
|
||||
tempListBox.setSelectedValue("Select " + field.getFieldName());
|
||||
}
|
||||
|
||||
// get vocabulary fields
|
||||
|
@ -694,7 +695,7 @@ public class MetaDataFieldSkeleton extends Composite{
|
|||
if(toReturn.get(0).equals(placeholder)){
|
||||
GWT.log("Skipping placeholder: "+placeholder);
|
||||
toReturn.clear();
|
||||
toReturn.add("");
|
||||
//toReturn.add("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue