log.debug("Hidden's value received:" + hiddenValue);
log.debug("Hidden's value sent to the client:" + hiddenRealValue);
}
if (hiddenValue == null) {
ValidationError error = new ValidationError();
error.setErrorKey(HDIVErrorCodes.REQUIRED_PARAMETERS);
error.setErrorParam(inputHidden.getId());
error.setErrorValue("null");
error.setErrorComponent(inputHidden.getClientId(context));
return error;
}
boolean correcto = this.hasEqualValue(hiddenValue, hiddenRealValue);
if (!correcto) {
ValidationError error = new ValidationError();
error.setErrorKey(HDIVErrorCodes.PARAMETER_VALUE_INCORRECT);
error.setErrorParam(inputHidden.getId());
error.setErrorValue(hiddenRealValue.toString());
error.setErrorComponent(inputHidden.getClientId(context));
return error;
}
} else {
// else, actual position isn't a table, but hidden is in a table
// and its clientId is incorrect
List<String> clientIds = inputHidden.getClientIds();
for (int i = 0; i < clientIds.size(); i++) {
String clientId = clientIds.get(i);
hiddenValue = request.getParameter(clientId);
hiddenRealValue = inputHidden.getRealValue(clientId);
if (log.isDebugEnabled()) {
log.debug("Hidden's value received:" + hiddenValue);
log.debug("Hidden's value sent to the client:" + hiddenRealValue);
}
if (hiddenValue == null) {
ValidationError error = new ValidationError();
error.setErrorKey(HDIVErrorCodes.REQUIRED_PARAMETERS);
error.setErrorParam(inputHidden.getId());
error.setErrorValue("null");
error.setErrorComponent(inputHidden.getClientId(context));
return error;
}
boolean correcto = hiddenValue.equals(hiddenRealValue);
if (!correcto) {
ValidationError error = new ValidationError();
error.setErrorKey(HDIVErrorCodes.PARAMETER_VALUE_INCORRECT);
error.setErrorParam(inputHidden.getId());
error.setErrorValue(hiddenRealValue.toString());
error.setErrorComponent(inputHidden.getClientId(context));
return error;
}
}
}