summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TForm.php
diff options
context:
space:
mode:
authorxue <>2006-06-11 22:01:52 +0000
committerxue <>2006-06-11 22:01:52 +0000
commitf30c38fcc9d6cdfa7aafa5078a58645192c11974 (patch)
tree51817c56b7295386e90fea5bf0f9fbd776a84bff /framework/Web/UI/TForm.php
parent233ad780df391ed4af569929c30a1370d2b440ef (diff)
Prado js files are not rendered at the beginning of the form
Diffstat (limited to 'framework/Web/UI/TForm.php')
-rw-r--r--framework/Web/UI/TForm.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php
index 948dea3e..e70d894a 100644
--- a/framework/Web/UI/TForm.php
+++ b/framework/Web/UI/TForm.php
@@ -70,12 +70,33 @@ class TForm extends TControl
*/
public function render($writer)
{
- $this->addAttributesToRender($writer);
- $writer->renderBeginTag('form');
$page=$this->getPage();
$page->beginFormRender($writer);
- $this->renderChildren($writer);
+ $textWriter=new TTextWriter;
+ $this->renderChildren(new THtmlWriter($textWriter));
+ $content=$textWriter->flush();
$page->endFormRender($writer);
+
+ $this->addAttributesToRender($writer);
+ $writer->renderBeginTag('form');
+
+ if($page->getClientSupportsJavaScript())
+ {
+ $cs=$page->getClientScript();
+ $cs->renderHiddenFields($writer);
+ $cs->renderScriptFiles($writer);
+ $cs->renderBeginScripts($writer);
+
+ $writer->write($content);
+
+ $cs->renderEndScripts($writer);
+ }
+ else
+ {
+ $cs->renderHiddenFields($writer);
+ $writer->write($content);
+ }
+
$writer->renderEndTag();
}