From fd76b5617e3c136be2f8b5374e7629d2bea77070 Mon Sep 17 00:00:00 2001 From: Jens Klaer Date: Thu, 22 Oct 2015 10:48:13 +0200 Subject: extended ISurroundable to provide the surrounding tag in addition to the id - ISurroundable introducing getSurroundingTag(), adjusted controls implementing the interface - TActiveDataGrid/TActiveRepeater now support changing the container tag to avoid invalid html in specific situations - revised corresponding quickstart demos --- framework/Web/UI/WebControls/TCheckBox.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'framework/Web/UI/WebControls') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index a28beac7..672aa9b2 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -284,11 +284,19 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } /** - * @return string the id of the surrounding tag or this clientID if no such tag needed + * @return string the tag used to wrap the control in. + */ + public function getSurroundingTag() + { + return 'span'; + } + + /** + * @return string the id of the surrounding tag or this clientID if no such tag needed. */ public function getSurroundingTagID() { - return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID(); + return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID(); } /** @@ -318,11 +326,11 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } else $onclick=''; - if($needspan=$this->getSpanNeeded()) - { - $writer->addAttribute('id',$this->getSurroundingTagID()); - $writer->renderBeginTag('span'); - } + if($needspan=$this->getSpanNeeded()) + { + $writer->addAttribute('id',$this->getSurroundingTagID()); + $writer->renderBeginTag($this->getSurroundingTag()); + } $clientID=$this->getClientID(); if(($text=$this->getText())!=='') { -- cgit v1.2.3