From 0dda82c2a13ed09a2520dda9b420e8f90703c67b Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 4 Dec 2005 04:25:45 +0000 Subject: --- framework/Web/UI/WebControls/TCheckBox.php | 40 +++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/WebControls/TCheckBox.php') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index 7b9d4702..ad83556e 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -103,9 +103,9 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl public function raisePostDataChangedEvent() { $page=$this->getPage(); - if($this->getAutoPostBack() && !$page->getIsPostBackEventControlRegistered()) + if($this->getAutoPostBack() && !$page->getPostBackEventTarget()) { - $page->setAutoPostBackControl($this); + $page->setPostBackEventTarget($this); if($this->getCausesValidation()) $page->validate($this->getValidationGroup()); } @@ -393,7 +393,41 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $writer->renderBeginTag('input'); $writer->renderEndTag(); } - // todo: onprerender??? + + protected function onPreRender($param) + { + parent::onPreRender($param); + $this->getPage()->registerRequiresPostBack($this); + } + + /* +protected internal override void OnPreRender(EventArgs e) +{ + base.OnPreRender(e); + bool flag1 = this.AutoPostBack; + if ((this.Page != null) && base.IsEnabled) + { + this.Page.RegisterRequiresPostBack(this); + if (flag1) + { + this.Page.RegisterPostBackScript(); + this.Page.RegisterFocusScript(); + if (this.CausesValidation && (this.Page.GetValidators(this.ValidationGroup).Count > 0)) + { + this.Page.RegisterWebFormsScript(); + } + } + } + if (!this.SaveCheckedViewState(flag1)) + { + this.ViewState.SetItemDirty("Checked", false); + if ((this.Page != null) && base.IsEnabled) + { + this.Page.RegisterEnabledControl(this); + } + } +} +*/ } ?> \ No newline at end of file -- cgit v1.2.3