From 7de06fe5ac3e9f2417e317fe8754cdf09574ccfb Mon Sep 17 00:00:00 2001
From: xue <>
Date: Sat, 21 Jan 2006 04:10:28 +0000
Subject: Removed UseSubmitBehavior and PostBackUrl properties from TButton.
 TButton demo completed.

---
 .../pages/Controls/Samples/TButton/Home.page       | 18 ----------
 framework/Web/UI/WebControls/TButton.php           | 40 ++--------------------
 2 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
index b2fe4c6c..7c5b90b4 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TButton/Home.page
@@ -46,24 +46,6 @@ A button causing validation:
 <com:TButton Text="submit" ValidationGroup="Group" />
 </td></tr>
 
-<tr><td class="samplenote">
-UseSubmitBehavior
-</td><td class="sampleaction">
-<com:TButton
-	Text="click me"
-	UseSubmitBehavior="false"
-	Click="buttonClicked" />
-</td></tr>
-
-<tr><td class="samplenote">
-PostBackUrl
-</td><td class="sampleaction">
-<com:TButton
-	Text="click me"
-	PostBackUrl="/" />
-</td></tr>
-
-
 </table>
 
 </com:TContent>
\ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index 85473349..02f35389 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -41,8 +41,6 @@
  * And the validation may be restricted within a certain group of validator
  * controls by setting {@link setValidationGroup ValidationGroup} property.
  * If validation is successful, the data will be post back to the same page.
- * You can change the postback target by setting the {@link setPostBackUrl PostBackUrl}
- * property.
  *
  * TButton displays the {@link setText Text} property as the button caption.
  *
@@ -70,7 +68,7 @@ class TButton extends TWebControl implements IPostBackEventHandler
 	{
 		$page=$this->getPage();
 		$page->ensureRenderInForm($this);
-		$writer->addAttribute('type',$this->getUseSubmitBehavior()?'submit':'button');
+		$writer->addAttribute('type','submit');
 		if(($uniqueID=$this->getUniqueID())!=='')
 			$writer->addAttribute('name',$uniqueID);
 		$writer->addAttribute('value',$this->getText());
@@ -87,7 +85,7 @@ class TButton extends TWebControl implements IPostBackEventHandler
 	}
 
 	/**
-	 * @return boolean true if validators are active and can cause validation.
+	 * @return boolean whether to perform validation if the button is clicked
 	 */
 	protected function canCauseValidation()
 	{
@@ -105,8 +103,6 @@ class TButton extends TWebControl implements IPostBackEventHandler
 	{
 		$options['CausesValidation'] = $this->getCausesValidation();
 		$options['ValidationGroup'] = $this->getValidationGroup();
-		$options['PostBackUrl'] = $this->getPostBackUrl();
-		$options['ClientSubmit'] = !$this->getUseSubmitBehavior();
 
 		return $options;
 	}
@@ -228,22 +224,6 @@ class TButton extends TWebControl implements IPostBackEventHandler
 		$this->setViewState('CommandParameter',$value,'');
 	}
 
-	/**
-	 * @return boolean whether to use the button as a submit button, default is true.
-	 */
-	public function getUseSubmitBehavior()
-	{
-		return $this->getViewState('UseSubmitBehavior',true);
-	}
-
-	/**
-	 * @param boolean whether to use the button as a submit button
-	 */
-	public function setUseSubmitBehavior($value)
-	{
-		$this->setViewState('UseSubmitBehavior',TPropertyValue::ensureBoolean($value),true);
-	}
-
 	/**
 	 * @return string the group of validators which the button causes validation upon postback
 	 */
@@ -259,22 +239,6 @@ class TButton extends TWebControl implements IPostBackEventHandler
 	{
 		$this->setViewState('ValidationGroup',$value,'');
 	}
-
-	/**
-	 * @return string the URL of the page to post to when the button is clicked, default is empty meaning post to the current page itself
-	 */
-	public function getPostBackUrl()
-	{
-		return $this->getViewState('PostBackUrl','');
-	}
-
-	/**
-	 * @param string the URL of the page to post to from the current page when the button is clicked, empty if post to the current page itself
-	 */
-	public function setPostBackUrl($value)
-	{
-		$this->setViewState('PostBackUrl',$value,'');
-	}
 }
 
 ?>
\ No newline at end of file
-- 
cgit v1.2.3