summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TForm.php
diff options
context:
space:
mode:
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();
}