From 37cd9aec35acd0cd03946fc6f26d7fe02c3c5d48 Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Tue, 14 Apr 2009 11:27:19 +0000 Subject: Fixed Issue#135 - Add AutoPostBack property to TActiveFileUpload --- .../Web/UI/ActiveControls/TActiveFileUpload.php | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TActiveFileUpload.php') diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php index a0a066f7..b935936b 100755 --- a/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -133,7 +133,30 @@ EOS; * default "Application.runtime.*" */ public function setTempPath($value){ - $this->setViewState('TempNamespace',$value,'Application.runtime.*'); + $this->setViewState('TempPath',$value,'Application.runtime.*'); + } + + /** + * @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. + * Note: When set to false, you will need to trigger the callback yourself. + */ + public function getAutoPostBack(){ + return $this->getViewState('AutoPostBack', true); + } + + /** + * @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. + * Note: When set to false, you will need to trigger the callback yourself. + */ + public function setAutoPostBack($value){ + $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true); + } + + /** + * @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false} + */ + public function getCallbackJavascript(){ + return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")"; } /** @@ -267,6 +290,7 @@ EOS; $options['indicatorID'] = $this->_busy->getClientID(); $options['completeID'] = $this->_success->getClientID(); $options['errorID'] = $this->_error->getClientID(); + $options['autoPostBack'] = $this->getAutoPostBack(); return $options; } @@ -313,4 +337,4 @@ EOS; $this->ensureChildControls(); return $this->_busy; } -} \ No newline at end of file +} -- cgit v1.2.3