diff options
| author | wei <> | 2006-01-18 04:20:26 +0000 | 
|---|---|---|
| committer | wei <> | 2006-01-18 04:20:26 +0000 | 
| commit | 0226f8f5f430d34b3cead40c4eb7b458933d16c6 (patch) | |
| tree | 68b21c4bec09ed73edc64019b4e20a2e3853d477 /framework/Web/UI/WebControls/TTextBox.php | |
| parent | e2219c91b98088289080bfa451d3083851eddf76 (diff) | |
update javascript library and usage in web controls
Diffstat (limited to 'framework/Web/UI/WebControls/TTextBox.php')
| -rw-r--r-- | framework/Web/UI/WebControls/TTextBox.php | 19 | 
1 files changed, 13 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 4eb42313..edf74a75 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -135,17 +135,18 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable  			$writer->addAttribute('disabled','disabled');
  		if($this->getAutoPostBack() && $page->getClientSupportsJavaScript())
  		{
 -			$writer->addAttribute('id',$this->getClientID());
 -			$options = $this->getAutoPostBackOptions();
 +			$writer->addAttribute('id',$this->getClientID());			
 +			$this->getPage()->getClientScript()->registerPostBackControl($this);
 +			/*$options = $this->getAutoPostBackOptions();
  			$scripts = $this->getPage()->getClientScript();
  			$postback = $scripts->getPostBackEventReference($this,'',$options,false);
  			$scripts->registerClientEvent($this, "change", $postback);
 -
 +			*
  			if($this->getTextMode() !== 'MultiLine')
  			{
  				$code = "if(Prado.TextBox.handleReturnKey(e)==false) Event.stop(e);";
  				$scripts->registerClientEvent($this, "keypress", $code);
 -			}
 +			}*/
  		}
  		parent::addAttributesToRender($writer);
  	}
 @@ -154,8 +155,14 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable  	 * Sets the post back options for this textbox.
  	 * @return TPostBackOptions
  	 */
 -	protected function getAutoPostBackOptions()
 +	public function getPostBackOptions()
  	{
 +		$options['EventTarget'] = $this->getUniqueID();
 +		$options['CausesValidation'] = $this->getCausesValidation();
 +		$options['ValidationGroup'] = $this->getValidationGroup();
 +		$options['TextMode'] = $this->getTextMode();
 +		return $options;
 +		/*
  		$option=new TPostBackOptions();
  		$group = $this->getValidationGroup();
  		$hasValidators = $this->getPage()->getValidators($group)->getCount()>0;
 @@ -164,7 +171,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable  			$option->setPerformValidation(true);
  			$option->setValidationGroup($group);
  		}
 -		$option->setAutoPostBack(true);
 +		$option->setAutoPostBack(true);*/
  	}
  	/**
  | 
