diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-01-10 19:27:47 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-08-23 12:15:02 +0200 |
commit | 606728e5c2fb1dfe2ca2760b9894f5c6d378d9b5 (patch) | |
tree | f0b6f3b8f71c18bfd709fdb26fb2685fd1f562b5 /framework/Web/UI/WebControls | |
parent | eb9269193cd9b2a50050460c5807652f38ae52ee (diff) |
Optimization: avoid duplicate creation of T*CheckBoxList, T*RadioButtonList js items
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBoxList.php | 10 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TRadioButtonList.php | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index af59545c..94278764 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) + { + } +} |