diff options
author | ctrlaltca@gmail.com <> | 2011-10-11 07:53:51 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-10-11 07:53:51 +0000 |
commit | 1b237f5c0a50fc3e986ec52fa6771eec0c7c351c (patch) | |
tree | 5bc58919ac7a1726db6faecc401b71201bc4850b /framework/Web | |
parent | a2ffee815dfbd9648629c52bff5be62f266e4c34 (diff) |
TActiveFileUpload: fix when 2 TActiveFileUpload are present in the same page and one of them in inside 2 (o more) nested templates (refs #90)
Diffstat (limited to 'framework/Web')
-rwxr-xr-x | framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js | 7 | ||||
-rwxr-xr-x | framework/Web/UI/ActiveControls/TActiveFileUpload.php | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index 443d9dd0..e25b5bed 100755 --- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -15,13 +15,6 @@ Prado.WebUI.TActiveFileUpload = Base.extend( Prado.Registry.set(options.inputID, this); - var tempfield = document.createElement('input'); - tempfield.id = "tempActiveUploadField"; - tempfield.name = "tempActiveUploadField"; - tempfield.value = this.options.targetID; - tempfield.type = "hidden"; - this.form.appendChild(tempfield); - // set up events if (options.autoPostBack){ Event.observe(this.input,"change",this.fileChanged.bind(this)); diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php index 2c85aff0..98a7f422 100755 --- a/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -97,7 +97,8 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback * the invocation of the attached event handlers. * @param TEventParameter event parameter to be passed to the event handlers */ - public function onFileUpload($param){ + public function onFileUpload($param) + { if ($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param == $this->_target->getUniqueID()){ // save the file so that it will persist past the end of this return. $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); @@ -217,7 +218,7 @@ EOS; */ public function raisePostDataChangedEvent() { - $this->onFileUpload($this->getPage()->getRequest()->itemAt('tempActiveUploadField')); + $this->onFileUpload($this->getPage()->getRequest()->itemAt('TActiveFileUpload_TargetId')); } protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params) |