diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TSlider.php')
-rw-r--r-- | framework/Web/UI/WebControls/TSlider.php | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php index 094dbd5b..7ac8f033 100644 --- a/framework/Web/UI/WebControls/TSlider.php +++ b/framework/Web/UI/WebControls/TSlider.php @@ -208,23 +208,32 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer public function setValues($value)
{
$this->setViewState('Values', TPropertyValue::ensureArray($value), array());
- }
-
- /**
- * @return TSliderHandle the control for the slider's handle.
- */
- public function getHandle ()
- {
- if ($this->_handle==null)
- {
- $this->_handle=prado::createComponent($this->getHandleClass(), $this);
- if (!$this->_handle instanceof TSliderHandle)
- {
- throw new TInvalidDataTypeException('slider_handle_class_invalid', get_class($this->_handle));
- }
- }
- return $this->_handle;
- }
+ } + + /** + * Create the child controls + * Override parent implementation to create the handle control + */
+ public function createChildControls() + { + $this->_handle=prado::createComponent($this->getHandleClass(), $this); + if (!$this->_handle instanceof TSliderHandle) + { + throw new TInvalidDataTypeException('slider_handle_class_invalid', get_class($this->_handle)); + } + $this->getControls()->add($this->_handle); + } + + /** + * This method will return the handle control. + * @return TSliderHandle the control for the slider's handle (must inherit from TSliderHandle} + */ + public function getHandle () + { + $this->ensureChildControls(); + return $this->_handle; + } +
/**
* @return string Custom handle class. Defaults to TSliderHandle;
@@ -361,18 +370,6 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer }
/**
- * Renders body content.
- * This method renders the handle of slider
- * This method overrides parent implementation
- * @param THtmlWriter writer
- */
- public function renderContents($writer)
- {
- // Render the handle
- $this->getHandle()->render ($writer);
- }
-
- /**
* Add the specified css classes to the track
* @param THtmlWriter writer
*/
|