From 606728e5c2fb1dfe2ca2760b9894f5c6d378d9b5 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 10 Jan 2014 19:27:47 +0100 Subject: Optimization: avoid duplicate creation of T*CheckBoxList, T*RadioButtonList js items --- framework/Web/UI/ActiveControls/TActiveCheckBoxList.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/ActiveControls/TActiveCheckBoxList.php') 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); + } +} + -- cgit v1.2.3