Show
Ignore:
Timestamp:
04/18/2008 03:17:29 AM (8 months ago)
Author:
tof
Message:

More fixes for #828

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/Web/UI/WebControls/TCheckBoxList.php

    r1850 r2430  
    361361 
    362362        /** 
     363         * Wether the list should be rendered inside a span or not 
     364         *  
     365         *@return boolean true if we need a span 
     366         */ 
     367        protected function getSpanNeeded () 
     368        { 
     369                if ($this->getRepeatLayout()===TRepeatLayout::Raw) 
     370                { 
     371                        $id=$this->getID(); 
     372                        // Check if we have a validator registered for this control 
     373                        foreach ($this->getPage()->getValidators() as $v) 
     374                        { 
     375                                if ($v->getControlToValidate()===$id) 
     376                                        return true; 
     377                        } 
     378                } 
     379                return false; 
     380        } 
     381         
     382        /** 
    363383         * Renders the checkbox list control. 
    364384         * This method overrides the parent implementation. 
     
    369389                if($this->getItemCount()>0) 
    370390                { 
     391                        if ($needSpan=$this->getSpanNeeded()) 
     392                        { 
     393                                $writer->addAttribute('id', $this->getClientId()); 
     394                                $writer->renderBeginTag('span'); 
     395                        } 
    371396                        $this->_isEnabled=$this->getEnabled(true); 
    372397                        $repeatInfo=$this->getRepeatInfo(); 
     
    381406                        $this->setAccessKey($accessKey); 
    382407                        $this->setTabIndex($tabIndex); 
     408                        if ($needSpan) 
     409                                $writer->renderEndTag(); 
    383410                } 
    384411                //checkbox skipped the client control script in addAttributesToRender 
     
    435462                return $options; 
    436463        } 
     464         
    437465} 
    438466