From cb78694cabf07515a097c44ef68e6d1df3fccf17 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 1 Jun 2006 02:13:12 +0000 Subject: Allow validation summary to function alone. --- framework/Web/UI/WebControls/TValidationSummary.php | 17 ++++++++++++++++- tests/FunctionalTests/selenium/php/TestRunner.php | 11 ++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index 87821292..027b0410 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -223,9 +223,24 @@ class TValidationSummary extends TWebControl { if(!$this->getEnabled(true) || !$this->getEnableClientScript()) return; + $cs = $this->getPage()->getClientScript(); + $cs->registerPradoScript('validator'); + + //need to register the validation manager is validation summary is alone. + $formID=$this->getPage()->getForm()->getClientID(); + $scriptKey = "TBaseValidator:$formID"; + if($this->getEnableClientScript() && !$cs->isEndScriptRegistered($scriptKey)) + { + $manager['FormID'] = $formID; + $options = TJavaScript::encode($manager); + $cs->registerPradoScript('validator'); + $cs->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});"); + } + + $options=TJavaScript::encode($this->getClientScriptOptions()); $script = "new Prado.WebUI.TValidationSummary({$options});"; - $this->getPage()->getClientScript()->registerEndScript($this->getClientID(), $script); + $cs->registerEndScript($this->getClientID(), $script); } /** diff --git a/tests/FunctionalTests/selenium/php/TestRunner.php b/tests/FunctionalTests/selenium/php/TestRunner.php index 95e2d5ca..9bb5ada3 100644 --- a/tests/FunctionalTests/selenium/php/TestRunner.php +++ b/tests/FunctionalTests/selenium/php/TestRunner.php @@ -47,10 +47,19 @@ Copyright 2004 ThoughtWorks, Inc var autFrame = document.getElementById('myiframe'); var autFrameDocument = getIframeDocument(autFrame); this.rootDocument = autFrameDocument; - var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html'); + var domViewer = window.open('core/domviewer/domviewer.html'); return false; } + Logger.prototype.openLogWindow = function() + { + this.logWindow = window.open( + "core/SeleniumLog.html", "SeleniumLog", + "width=600,height=250,bottom=0,right=0,status,scrollbars,resizable" + ); + return this.logWindow; + } + var post_results_to = ""; -- cgit v1.2.3