From c2981557f2112fbf93267058ad7f9c361bf2f180 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 11 Jan 2006 05:35:34 +0000 Subject: Fixed many issues with DataBoundControls. Added Prado Composer Demo (not done yet). --- demos/composer/protected/pages/Home.php | 120 ++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 demos/composer/protected/pages/Home.php (limited to 'demos/composer/protected/pages/Home.php') diff --git a/demos/composer/protected/pages/Home.php b/demos/composer/protected/pages/Home.php new file mode 100644 index 00000000..a2281828 --- /dev/null +++ b/demos/composer/protected/pages/Home.php @@ -0,0 +1,120 @@ +IsPostBack) + { + $this->Repeater->setDataSource($this->getInitialProperties()); + $this->Repeater->dataBind(); + } + else + $this->Repeater->ensureChildControls(); + } + + protected function getInitialProperties() + { + return array( + new PropertyDefinition, + new PropertyDefinition, + new PropertyDefinition, + new PropertyDefinition, + ); + } + + public function generateCode($sender,$param) + { + $code="ClassName->Text." extends ".$this->ParentClass->Text."implements ".$this->Interfaces->Text; + $code.="\n"; + $code.="{\n"; + $code.="}\n"; + $code.="?>"; + $this->SourceCode->Text=htmlentities($code); + } +} + +class PropertyDefinition extends TComponent +{ + private $_name=''; + private $_type='string'; + private $_default=''; + private $_readOnly=false; + private $_protected=false; + private $_storage='ViewState'; + private $_comments=''; + + public function getName() + { + return $this->_name; + } + + public function setName($value) + { + $this->_name=$value; + } + + public function getType() + { + return $this->_type; + } + + public function setType($value) + { + $this->_type=$value; + } + + public function getDefaultValue() + { + return $this->_default; + } + + public function setDefaultValue($value) + { + $this->_default=$value; + } + + public function getReadOnly() + { + return $this->_readOnly; + } + + public function setReadOnly($value) + { + $this->_readOnly=TPropertyValue::ensureBoolean($value); + } + + public function getIsProtected() + { + return $this->_protected; + } + + public function setIsProtected($value) + { + $this->_protected=TPropertyValue::ensureBoolean($value); + } + + public function getStorage() + { + return $this->_storage; + } + + public function setStorage($value) + { + $this->_storage=$value; + } + + public function getComments() + { + return $this->_comments; + } + + public function setComments($value) + { + $this->_comments=$value; + } +} + +?> \ No newline at end of file -- cgit v1.2.3