Changeset 2430 for trunk/framework/Web/UI/WebControls/TCheckBoxList.php
- Timestamp:
- 04/18/2008 03:17:29 AM (8 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/Web/UI/WebControls/TCheckBoxList.php
r1850 r2430 361 361 362 362 /** 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 /** 363 383 * Renders the checkbox list control. 364 384 * This method overrides the parent implementation. … … 369 389 if($this->getItemCount()>0) 370 390 { 391 if ($needSpan=$this->getSpanNeeded()) 392 { 393 $writer->addAttribute('id', $this->getClientId()); 394 $writer->renderBeginTag('span'); 395 } 371 396 $this->_isEnabled=$this->getEnabled(true); 372 397 $repeatInfo=$this->getRepeatInfo(); … … 381 406 $this->setAccessKey($accessKey); 382 407 $this->setTabIndex($tabIndex); 408 if ($needSpan) 409 $writer->renderEndTag(); 383 410 } 384 411 //checkbox skipped the client control script in addAttributesToRender … … 435 462 return $options; 436 463 } 464 437 465 } 438 466
