if (fragmentMap.containsKey("messages")) {
requestContext.getFlashScope().put("errors", errors);
replaceFragment("messages", fragmentMap, new HashMap());
} else {
//TODO ZK 3.6 use "throw new WrongValuesException(WrongValueException[])"
final Message msg = errors[0];
Component comp = null;
final Object source = msg.getSource();
if (source instanceof Component) {
comp = (Component) source;
} else if (source instanceof String) {
comp = (Component) ZkFlowContextManager.getSelf(exec).getAttribute((String)source, false);
}
if (comp != null) {
//cannot throw out exception here, or the flow state will out of sync
//save in executution and throw it later in ZkFlowHandlerAdapter.handl()
ZkFlowContextManager.setWrongValueException(exec, new WrongValueException(comp, msg.getText()));
} else {
requestContext.getViewScope().put("errors", errors);
requestContext.getExternalContext().requestFlowExecutionRedirect();
}
}