Hi, Tried to get 'validationError dialogBox' the dialog box is coming but the 'EDIT' page gets closed. We have used 'editAttributes' request filter. Whereas, for ADD/CHECK-IN operation it is working fine.
Below is the code snippet:
JSONArray jsonPost =JSONArray.parse(request.getParameter("json_post"));
JSONObject firstItem = (JSONObject) jsonPost.get(0);
JSONArray jsonAttributes = (JSONArray) firstItem.get("criterias");
JSONObject errorMessage = new JSONObject();
JSONObject paramater = new JSONObject();
JSONArray listError = new JSONArray();
boolean flag=false;
for (Object attribute : jsonAttributes) {
JSONObject jsonAttribute = (JSONObject) attribute;
String name = (String) jsonAttribute.get("name");
try {
if(name.equalsIgnoreCase("strsExport")) {
String value=jsonAttribute.get("value").toString();
if(value.equalsIgnoreCase("test")) {
flag=true;
}
}
} catch (Exception e) {
continue;
}}
if(flag==true) {
String explanation = "Coherence Control: One or more combination of property values is not authorized:";
String userResponse = "Export : abc";
paramater.put("text", "Validation Error");
paramater.put("explanation", explanation);
paramater.put("userResponse", userResponse);
listError.add(paramater);
errorMessage = new JSONObject();
errorMessage.put("errors", listError);
return errorMessage;
}
return null;
}
#IBMContentNavigator(ICN)#Support#SupportMigration