public function getErrorMessages($recursive = false): ?array
  {
    $ret = [];
    if ($recursive)
    {
      foreach ($this->controls as $control)
      {
        $tmp = $control->getErrorMessages(true);
        if (is_array($tmp))
        {
          $ret = array_merge($ret, $tmp);
        }
      }
    }

    if (isset($this->errorMessages))
    {
      $ret = array_merge($ret, $this->errorMessages);
    }

    if (empty($ret)) $ret = null;

    return $ret;
  }