/**
  * Validate the child items if the dialog is visible and the clicked button requires validation.
  * This piece of magic makes validation specific to the dialog if an action is coming from the dialog,
  * and prevents the controls in the dialog from being validated if the action is coming from outside
  * the dialog.
  *
  * @return bool
  */
 public function ValidateControlAndChildren()
 {
     if ($this->blnIsOpen) {
         // don't validate a closed dialog
         if (!empty($this->mixButtons)) {
             // using built-in dialog buttons
             if (!empty($this->blnValidationArray[$this->strClickedButtonId])) {
                 return parent::ValidateControlAndChildren();
             }
         } else {
             // using QButtons placed in the control
             return parent::ValidateControlAndChildren();
         }
     }
     return true;
 }