use of org.openforis.collect.designer.form.CodeListFormObject in project collect by openforis.
the class CodeListsVM method closeCodeListImportPopUp.
@GlobalCommand
public void closeCodeListImportPopUp() {
closePopUp(codeListImportPopUp);
codeListImportPopUp = null;
if (editedItem != null) {
boolean hasMultipleLevels = editedItem.getHierarchy().size() > 1;
Type type = hasMultipleLevels ? Type.HIERARCHICAL : Type.FLAT;
CodeListFormObject fo = (CodeListFormObject) formObject;
fo.setType(type.name());
selectedItemsPerLevel = new ArrayList<CodeListItem>();
initItemsPerLevel();
notifyChange("formObject", "listLevels", "selectedItemsPerLevel");
}
}
use of org.openforis.collect.designer.form.CodeListFormObject in project collect by openforis.
the class CodeListsVM method typeChanged.
@Command
public void typeChanged(@BindingParam("type") String type) {
Type typeEnum = CodeListFormObject.Type.valueOf(type);
switch(typeEnum) {
case HIERARCHICAL:
addLevel();
break;
default:
editedItem.removeLevel(0);
}
CodeListFormObject fo = (CodeListFormObject) formObject;
fo.setType(type);
notifyChange("formObject", "listLevels");
}
Aggregations