summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorctrlaltca <>2012-05-10 21:09:10 +0000
committerctrlaltca <>2012-05-10 21:09:10 +0000
commit0b60336c37f91d79ecaefbe0f8b86cc324264451 (patch)
treef780d8a1fd6d9df7f3bb6676062645b4d0e06a37 /framework/Web/UI/WebControls
parentafaebc9ce82a6cec8cff83da781c44411838df9c (diff)
fix for #399, addresses ratings.js and inlineeditor.js
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TRatingList.php12
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php42
2 files changed, 32 insertions, 22 deletions
diff --git a/framework/Web/UI/WebControls/TRatingList.php b/framework/Web/UI/WebControls/TRatingList.php
index f939a210..457bcd74 100644
--- a/framework/Web/UI/WebControls/TRatingList.php
+++ b/framework/Web/UI/WebControls/TRatingList.php
@@ -283,7 +283,8 @@ class TRatingList extends TRadioButtonList
parent::onPreRender($param);
$this->publishStyle($this->getRatingStyle());
$this->_ratingImages = $this->publishImages($this->getRatingStyle());
- }
+ $this->registerClientScript();
+ }
/**
* @param string rating style name
@@ -313,6 +314,15 @@ class TRatingList extends TRadioButtonList
}
/**
+ * Registers the relevant JavaScript.
+ */
+ protected function registerClientScript()
+ {
+ $cs=$this->getPage()->getClientScript();
+ $cs->registerPradoScript('ratings');
+ }
+
+ /**
* @param string asset file in the self::SCRIPT_PATH directory.
* @return string asset file url.
*/
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index a19d35cd..6535fc63 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2011 PradoSoft
+ * @copyright Copyright &copy; 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -67,7 +67,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
*/
private $_safeText;
private $_dataChanged=false;
- private $_isValid=true;
+ private $_isValid=true;
/**
* @return string tag name of the textbox
@@ -129,7 +129,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$writer->addAttribute('value',$text);
$writer->addAttribute('type','password');
}
-
+
if(($act=$this->getAutoCompleteType())!=='None')
{
if($act==='Disabled')
@@ -149,7 +149,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
$writer->addAttribute('vcard_name','vCard.'.$act);
}
}
-
+
if(($cols=$this->getColumns())>0)
$writer->addAttribute('size',"$cols");
if(($maxLength=$this->getMaxLength())>0)
@@ -246,23 +246,23 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
return $this->getText();
}
- /**
- * Returns true if this control validated successfully.
- * Defaults to true.
- * @return bool wether this control validated successfully.
- */
- public function getIsValid()
- {
- return $this->_isValid;
- }
- /**
- * @param bool wether this control is valid.
- */
- public function setIsValid($value)
- {
- $this->_isValid=TPropertyValue::ensureBoolean($value);
- }
-
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
/**
* Raises <b>OnTextChanged</b> event.
* This method is invoked when the value of the {@link getText Text}