From 97869b581fc2af1724dbf07652533f7d2ded9371 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/WebControls/TCheckBoxList.php | 10 +++++++++- framework/Web/UI/WebControls/TRadioButtonList.php | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/WebControls') diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index 16e6b7f5..029b6c89 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -72,7 +72,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont */ protected function createRepeatedControl() { - return new TCheckBox; + return new TCheckBoxItem; } /** @@ -499,3 +499,11 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont } +class TCheckBoxItem extends TCheckBox { + /** + * Override client implementation to avoid emitting the javascript + */ + protected function renderClientControlScript($writer) + { + } +} diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php index bead3582..3afe3ec2 100644 --- a/framework/Web/UI/WebControls/TRadioButtonList.php +++ b/framework/Web/UI/WebControls/TRadioButtonList.php @@ -47,7 +47,7 @@ class TRadioButtonList extends TCheckBoxList */ protected function createRepeatedControl() { - return new TRadioButton; + return new TRadioButtonItem; } /** @@ -97,3 +97,11 @@ class TRadioButtonList extends TCheckBoxList } } +class TRadioButtonItem extends TRadioButton { + /** + * Override client implementation to avoid emitting the javascript + */ + protected function renderClientControlScript($writer) + { + } +} -- cgit v1.2.3