summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TCheckBox.php15
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php4
-rw-r--r--framework/Web/UI/WebControls/TListControlValidator.php4
-rw-r--r--framework/Web/UI/WebControls/TRadioButton.php5
4 files changed, 19 insertions, 9 deletions
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php
index cb8fb30d..fda0480d 100644
--- a/framework/Web/UI/WebControls/TCheckBox.php
+++ b/framework/Web/UI/WebControls/TCheckBox.php
@@ -240,6 +240,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
{
$attributes=$this->getAttributes();
$value=$attributes->remove('value');
+ // onclick js should only be added to input tag
+ $onclick=$attributes->remove('onclick');
if($attributes->getCount())
{
$writer->addAttributes($attributes);
@@ -248,6 +250,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
if($value!==null)
$attributes->add('value',$value);
}
+ else
+ $onclick='';
if($needSpan)
$writer->renderBeginTag('span');
$clientID=$this->getClientID();
@@ -256,16 +260,16 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
if($this->getTextAlign()==='Left')
{
$this->renderLabel($writer,$clientID,$text);
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
}
else
{
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
$this->renderLabel($writer,$clientID,$text);
}
}
else
- $this->renderInputTag($writer,$clientID);
+ $this->renderInputTag($writer,$clientID,$onclick);
if($needSpan)
$writer->renderEndTag();
}
@@ -334,14 +338,17 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
* Renders a checkbox input element.
* @param THtmlWriter the writer for the rendering purpose
* @param string checkbox id
+ * @param string onclick js
*/
- protected function renderInputTag($writer,$clientID)
+ protected function renderInputTag($writer,$clientID,$onclick)
{
if($clientID!=='')
$writer->addAttribute('id',$clientID);
$writer->addAttribute('type','checkbox');
if(($value = $this->getValueAttribute()) !== '')
$writer->addAttribute('value',$value);
+ if($onclick!=='')
+ $writer->addAttribute('onclick',$onclick);
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
if($this->getChecked())
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 6ff6faba..82c243ca 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -1523,7 +1523,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
protected function renderTable($writer)
{
$this->renderBeginTag($writer);
- if($this->_header->getVisible())
+ if($this->_header && $this->_header->getVisible())
{
$writer->writeLine();
$writer->renderBeginTag('thead');
@@ -1536,7 +1536,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$item->renderControl($writer);
$writer->renderEndTag();
- if($this->_footer->getVisible())
+ if($this->_footer && $this->_footer->getVisible())
{
$writer->writeLine();
$writer->renderBeginTag('tfoot');
diff --git a/framework/Web/UI/WebControls/TListControlValidator.php b/framework/Web/UI/WebControls/TListControlValidator.php
index 0d0940ab..be69085d 100644
--- a/framework/Web/UI/WebControls/TListControlValidator.php
+++ b/framework/Web/UI/WebControls/TListControlValidator.php
@@ -36,7 +36,7 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* <com:TListItem Text="item3" Value="value3" />
* </com:TListBox>
*
- * <com:TRequiredListValidator
+ * <com:TListControlValidator
* ControlToValidate="listbox"
* MinSelection="2"
* ErrorMessage="Please select at least 2" />
@@ -49,7 +49,7 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator');
* <com:TListItem Text="item3" Value="value3" />
* </com:TCheckBoxList>
*
- * <com:TRequiredListValidator
+ * <com:TListControlValidator
* ControlToValidate="checkboxes"
* RequiredSelections="value1"
* MinSelection="2"
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php
index 6a5ade4d..dc7ba057 100644
--- a/framework/Web/UI/WebControls/TRadioButton.php
+++ b/framework/Web/UI/WebControls/TRadioButton.php
@@ -139,14 +139,17 @@ class TRadioButton extends TCheckBox
* Renders a radiobutton input element.
* @param THtmlWriter the writer for the rendering purpose
* @param string checkbox id
+ * @param string onclick js
*/
- protected function renderInputTag($writer,$clientID)
+ protected function renderInputTag($writer,$clientID,$onclick)
{
if($clientID!=='')
$writer->addAttribute('id',$clientID);
$writer->addAttribute('type','radio');
$writer->addAttribute('name',$this->getUniqueGroupName());
$writer->addAttribute('value',$this->getValueAttribute());
+ if($onclick!=='')
+ $writer->addAttribute('onclick',$onclick);
if($this->getChecked())
$writer->addAttribute('checked','checked');
if(!$this->getEnabled(true))