diff options
Diffstat (limited to 'lib/prado/framework/Web/UI/ActiveControls')
40 files changed, 178 insertions, 55 deletions
diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php index ae5b7f0..cc88423 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -94,6 +94,9 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php index 034666f..058ba70 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -88,6 +88,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update( @@ -103,6 +106,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv public function setChecked($value) { $value = TPropertyValue::ensureBoolean($value); + if(parent::getChecked() === $value) + return; + parent::setChecked($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->check($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php index dfcb72c..4b31d86 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -63,6 +63,17 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall } /** + * Since at least a control with id is needed to update the content during callback, + * always force the surrounding span to be rendered, so initially empty lists can be + * updated later. + *@return boolean always true + */ + protected function getSpanNeeded () + { + return true; + } + + /** * Override parent implementation, no javascript is rendered here instead * the javascript required for active control is registered in {@link addAttributesToRender}. */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php index 4093d8f..01a88a4 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php index 0cd39c7..f68c7a3 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php index 18f9f5f..0814c7c 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -104,6 +104,9 @@ class TActiveCustomValidator extends TCustomValidator */ public function setIsValid($value) { + // Always update the clientside, since the clientside's value for IsValid + // it could have been changed by the clientside validation. + parent::setIsValid($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -137,11 +140,15 @@ class TActiveCustomValidator extends TCustomValidator } /** - * Sets the text for the error message. Updates client-side erorr message. + * Sets the text for the error message. Updates client-side error message. * @param string the error message */ public function setErrorMessage($value) { + if(parent::getErrorMessage() === $value) + return; + + parent::setErrorMessage($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php index 6328bac..72f9953 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php @@ -5,7 +5,7 @@ * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -89,6 +89,9 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I * @param string text content for the textbox */ public function setText($value){ + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){ $cb=$this->getPage()->getCallbackClient(); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php index 3245ea6..2f09c03 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php index 6f051ba..0435041 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -101,8 +101,7 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback // save the file so that it will persist past the end of this return. $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); parent::saveAs($localName); - - $this->_localName = $localName; + $this->_localName = $localName; $params = new TActiveFileUploadCallbackParams; $params->localName = $localName; diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php index f87ff07..fbd8eda 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php @@ -4,7 +4,7 @@ * * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls @@ -55,6 +55,9 @@ class TActiveHiddenField extends THiddenField implements ICallbackEventHandler, */ public function setValue($value) { + if(parent::getValue() === $value) + return; + parent::setValue($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) $this->getPage()->getCallbackClient()->setValue($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php index 2ffee7e..5e98250 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -50,6 +50,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -61,6 +64,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide() && $value !== '') { @@ -77,6 +83,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setNavigateUrl($value) { + if(parent::getNavigateUrl() === $value) + return; + parent::setNavigateUrl($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -92,6 +101,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setTarget($value) { + if(parent::getTarget() === $value) + return; + parent::setTarget($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'target', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php index 13d5314..4058599 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -48,6 +48,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setAlternateText($value) { + if(parent::getAlternateText() === $value) + return; + parent::setAlternateText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value); @@ -62,6 +65,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setImageAlign($value) { + if(parent::getImageAlign() === $value) + return; + parent::setImageAlign($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'align', $value); @@ -72,6 +78,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'src', $value); @@ -82,6 +91,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setDescriptionUrl($value) { + if(parent::getDescriptionUrl() === $value) + return; + parent::setDescriptionUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php index 351a996..6f2ceed 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -58,6 +58,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setAlternateText($value) { + if(parent::getAlternateText() === $value) + return; + parent::setAlternateText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value); @@ -72,6 +75,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setImageAlign($value) { + if(parent::getImageAlign() === $value) + return; + parent::setImageAlign($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'align', $value); @@ -82,6 +88,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'src', $value); @@ -92,6 +101,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setDescriptionUrl($value) { + if(parent::getDescriptionUrl() === $value) + return; + parent::setDescriptionUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php index 70ff20e..a0825f8 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -55,6 +55,9 @@ class TActiveLabel extends TLabel implements IActiveControl */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -68,6 +71,9 @@ class TActiveLabel extends TLabel implements IActiveControl */ public function setForControl($value) { + if(parent::getForControl() === $value) + return; + parent::setForControl($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php index aaf2d35..7c2159a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -95,6 +95,9 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -131,6 +134,9 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback */ public function setEnabled($value) { + if(parent::getEnabled() === $value) + return; + parent::setEnabled($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php index e32a8eb..82fe662 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -85,6 +85,9 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH */ public function setSelectionMode($value) { + if(parent::getSelectionMode() === $value) + return; + parent::setSelectionMode($value); $multiple = $this->getIsMultiSelect(); $id = $this->getUniqueID(); $multi_id = $id.'[]'; diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php index 927912b..04539f3 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php index 215706e..45c137d 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php @@ -92,9 +92,11 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveViewIndex($value) { - $old=parent::getActiveViewIndex(); + if(parent::getActiveViewIndex() === $value) + return; + parent::setActiveViewIndex($value); - if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); } @@ -104,9 +106,11 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveView($value) { - $old=parent::getActiveView(); + if(parent::getActiveView() === $value) + return; + parent::setActiveView($value); - if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); } } diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 1803f44..2cdcaba 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -5,7 +5,7 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php index e99743f..d8d2fb6 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php @@ -4,7 +4,7 @@ * * @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com) * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php index 5192b0d..992ccb8 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php index 90190a1..8dd3927 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -87,6 +87,9 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update( @@ -102,6 +105,9 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba public function setChecked($value) { $value = TPropertyValue::ensureBoolean($value); + if(parent::getChecked() === $value) + return; + parent::setChecked($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->check($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php index 9acb672..e6b0cbb 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php index a154eb6..9c985d5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php @@ -5,7 +5,7 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls @@ -80,6 +80,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setReadOnly($value) { + if(parent::getReadOnly() === $value) + return; + parent::setReadOnly($value); $value = $this->getReadOnly(); $this->callClientFunction('setReadOnly',$value); @@ -90,6 +93,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setRating($value) { + if(parent::getRating() === $value) + return; + parent::setRating($value); $value = $this->getRating(); $this->callClientFunction('setRating',$value); @@ -115,6 +121,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setCaption($value) { + if(parent::getCaption() === $value) + return; + parent::setCaption($value); // if it's an active control, this should not be needed. $this->callClientFunction('setCaption',$value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php index f80b498..fa1740e 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -62,6 +62,9 @@ class TActiveTextBox extends TTextBox implements ICallbackEventHandler, IActiveC */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) $this->getPage()->getCallbackClient()->setValue($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php b/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php index e396e11..744565a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -18,6 +18,9 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); /** * TAutoComplete class. * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiAutoComplete} instead. + * * TAutoComplete is a textbox that provides a list of suggestion on * the current partial word typed in the textbox. The suggestions are * requested using callbacks, and raises the {@link onSuggestion OnSuggestion} @@ -78,6 +81,7 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @package System.Web.UI.ActiveControls * @since 3.1 + * @deprecated Use TJuiAutoComplete instead */ class TAutoComplete extends TActiveTextBox implements INamingContainer { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php index 01583eb..5ac51fd 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TCallback.php index 1aae6ce..eb78b54 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 1f631f2..12309bb 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php index 874aeb4..4cb482a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -38,11 +38,8 @@ * * - <b>PostState</b> true to collect the form inputs and post them during callback, default is true. * - <b>RequestTimeOut</b> The request timeout in milliseconds. - * - <b>HasPriority</b> true to ensure that the callback request will be sent - * immediately and will abort existing prioritized requests. It does not affect - * callbacks that are not prioritized. * - <b>EnablePageStateUpdate</b> enable the callback response to enable the - * viewstate update. This will automatically set HasPriority to true when enabled. + * viewstate update. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @package System.Web.UI.ActiveControls @@ -239,23 +236,23 @@ class TCallbackClientSide extends TClientSideOptions * @return boolean true if the callback request has priority and will abort * existing prioritized request in order to send immediately. It does not * affect callbacks that are not prioritized. Default is true. + * @deprecated since 3.3.0 */ public function getHasPriority() { - $option = $this->getOption('HasPriority'); - return ($option===null) ? true : $option; + return true; } /** * @param boolean true to ensure that the callback request will be sent * immediately and will abort existing prioritized requests. It does not * affect callbacks that are not prioritized. + * @deprecated since 3.3.0 */ public function setHasPriority($value) { - $hasPriority = TPropertyValue::ensureBoolean($value); - $this->setOption('HasPriority', $hasPriority); - if(!$hasPriority) + // mimic the old behavior + if(!$value) $this->setEnablePageStateUpdate(false); } @@ -269,8 +266,6 @@ class TCallbackClientSide extends TClientSideOptions { $enabled = TPropertyValue::ensureBoolean($value); $this->setOption('EnablePageStateUpdate', $enabled); - if($enabled) - $this->setHasPriority(true); } /** diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php index 9306aec..5d585c4 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php index e79561d..e307145 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php index 4a1c41b..115c4c6 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php b/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php index 3f6008b..830200e 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php @@ -11,6 +11,9 @@ /** * TDraggable is a control which can be dragged * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiDraggable} instead. + * * This control will make "draggable" control. * Properties : * @@ -25,6 +28,7 @@ * @copyright Copyright © 2008, PradoSoft * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls + * @deprecated Use TJuiDraggable instead */ class TDraggable extends TPanel { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php b/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php index 49eb0db..216d3db 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php @@ -21,6 +21,10 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); /** * TDropContainer is a panel where TDraggable controls can be dropped. + * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiDroppable} instead. + * * When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised. * The {@link TDropContainerEventParameter} param will contain the dropped control. * @@ -39,6 +43,7 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); * @copyright Copyright © 2008, PradoSoft * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls + * @deprecated Use TJuiDroppable instead */ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php index d990e09..aa00331 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php index d267729..2515184 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -13,7 +13,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox'); /** * TInPlaceTextBox Class - * * + * * TInPlaceTextBox is a component rendered as a label and allows its * contents to be edited by changing the label to a textbox when * the label is clicked or when another control or html element with @@ -135,6 +135,9 @@ class TInPlaceTextBox extends TActiveTextBox */ public function setText($value) { + if(TTextBox::getText() === $value) + return; + TTextBox::setText($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -152,6 +155,9 @@ class TInPlaceTextBox extends TActiveTextBox public function setReadOnly ($value) { $value=TPropertyValue::ensureBoolean($value); + if(TTextBox::getReadOnly() === $value) + return; + TTextBox::setReadOnly($value); if ($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php index b643de4..038f76d 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -46,6 +46,10 @@ class TTimeTriggeredCallback extends TCallback $interval = TPropertyValue::ensureFloat($value); if($interval <= 0) throw new TConfigurationException('callback_interval_be_positive', $this->getID()); + + if($this->getInterval() === $value) + return; + $this->setViewState('Interval', $interval, 1); if ($this->getActiveControl()->canUpdateClientSide()){ $client = $this->getPage()->getCallbackClient(); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php index 7675bc8..faebaf5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php index 87a7d60..7f9a6b5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ |