boolean hasDefaultContext = getDefaultBGContext() != null;
if (hasDefaultContext) {
groupChooseSubContainer.setErrorComponent(errorGroupItemLayout, this.flc);
// FIXING LINK ONLY IF A DEFAULTCONTEXT EXISTS
fixGroupError = new FormLinkImpl("error.fix", "create");
// link
fixGroupError.setCustomEnabledLinkCSS("b_button");
errorGroupItemLayout.add(fixGroupError);
fixGroupError.setErrorKey(labelKey, params);
fixGroupError.showError(true);
fixGroupError.showLabel(false);
// hinty to pass the information if one group is
// missing or if 2 or more groups are missing
// (see fixGroupErrer.getUserObject to understand)
// e.g. if userobject String[].lenght == 1 -> one group only
// String[].lenght > 1 -> show bulkmode creation group
if (missingGroups.size() > 1) {
fixGroupError.setUserObject(new String[] { csvMissGrps, "dummy" });
} else {
fixGroupError.setUserObject(new String[] { csvMissGrps });
}
} else {
// fix helper link not possible -> errortext only
groupChooseSubContainer.setErrorKey(labelKey, params);
}
/*
*
*/
groupChooseSubContainer.showError(true);
} else {
// no more errors
groupChooseSubContainer.clearError();
}
}
if (!easyAreaTE.isEmpty()) {
// check whether areas exist
activeAreaSelection = easyAreaTE.getValue().split(",");
boolean exists = false;
Set<String> missingAreas = new HashSet<String>();
for (int i = 0; i < activeAreaSelection.length; i++) {
String trimmed = activeAreaSelection[i].trim();
exists = cev.existsArea(trimmed);
if (!exists) {
missingAreas.add(trimmed);
}
}
if (missingAreas.size() > 0) {
retVal = false;
String labelKey = missingAreas.size() == 1 ? "error.notfound.name" : "error.notfound.names";
String csvMissAreas = StringHelper.formatAsCSVString(missingAreas);
String[] params = new String[] { "-", csvMissAreas };
/*
* create error with link to fix it
*/
String vc_errorPage = velocity_root + "/erroritem.html";
FormLayoutContainer errorAreaItemLayout = (FormLayoutContainer) FormLayoutContainer.createCustomFormLayout("errorareaitem",
getTranslator(), vc_errorPage);
boolean hasDefaultContext = getDefaultBGContext() != null;
if (hasDefaultContext) {
areaChooseSubContainer.setErrorComponent(errorAreaItemLayout, this.flc);
// FXINGIN LINK ONLY IF DEFAULT CONTEXT EXISTS
fixAreaError = new FormLinkImpl("error.fix", "create");// erstellen
// link
fixAreaError.setCustomEnabledLinkCSS("b_button");
errorAreaItemLayout.add(fixAreaError);
fixAreaError.setErrorKey(labelKey, params);