summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-01-10 19:27:47 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-08-23 12:15:02 +0200
commit606728e5c2fb1dfe2ca2760b9894f5c6d378d9b5 (patch)
treef0b6f3b8f71c18bfd709fdb26fb2685fd1f562b5 /framework/Web/UI/ActiveControls
parenteb9269193cd9b2a50050460c5807652f38ae52ee (diff)
Optimization: avoid duplicate creation of T*CheckBoxList, T*RadioButtonList js items
Diffstat (limited to 'framework/Web/UI/ActiveControls')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCheckBoxList.php17
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRadioButtonList.php17
2 files changed, 32 insertions, 2 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
index aa2d5f94..9280f0e8 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
@@ -76,7 +76,7 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall
*/
protected function createRepeatedControl()
{
- $control = new TActiveCheckBox;
+ $control = new TActiveCheckBoxListItem;
$control->getAdapter()->setBaseActiveControl($this->getActiveControl());
return $control;
}
@@ -117,3 +117,18 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall
}
+class TActiveCheckBoxListItem extends TActiveCheckBox
+{
+ /**
+ * Override client implementation to avoid emitting the javascript
+ *
+ * @param THtmlWriter the writer for the rendering purpose
+ * @param string checkbox id
+ * @param string onclick js
+ */
+ protected function renderInputTag($writer,$clientID,$onclick)
+ {
+ TCheckBox::renderInputTag($writer,$clientID,$onclick);
+ }
+}
+
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
index 5c76aed1..503841a3 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
@@ -77,7 +77,7 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl,
*/
protected function createRepeatedControl()
{
- $control = new TActiveRadioButton;
+ $control = new TActiveRadioButtonItem;
$control->getAdapter()->setBaseActiveControl($this->getActiveControl());
return $control;
}
@@ -117,3 +117,18 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl,
}
}
+
+class TActiveRadioButtonItem extends TActiveRadioButton
+{
+ /**
+ * Override client implementation to avoid emitting the javascript
+ *
+ * @param THtmlWriter the writer for the rendering purpose
+ * @param string checkbox id
+ * @param string onclick js
+ */
+ protected function renderInputTag($writer,$clientID,$onclick)
+ {
+ TRadioButton::renderInputTag($writer,$clientID,$onclick);
+ }
+}