summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TDropDownList
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /demos/quickstart/protected/pages/Controls/Samples/TDropDownList
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples/TDropDownList')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php136
1 files changed, 68 insertions, 68 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
index 133a797a..74e47b6c 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
@@ -1,69 +1,69 @@
-<?php
-
-class Home extends TPage
-{
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $data=array('item 1','item 2','item 3','item 4');
- $this->DBDropDownList1->DataSource=$data;
- $this->DBDropDownList1->dataBind();
-
- $data=array('key 1'=>'item 1','key 2'=>'item 2',
- 'key 3'=>'item 3','key 4'=>'item 4');
- $this->DBDropDownList2->DataSource=$data;
- $this->DBDropDownList2->dataBind();
-
- $data=array(
- array('id'=>'001','name'=>'John','age'=>31),
- array('id'=>'002','name'=>'Mary','age'=>30),
- array('id'=>'003','name'=>'Cary','age'=>20));
- $this->DBDropDownList3->DataSource=$data;
- $this->DBDropDownList3->dataBind();
- }
- }
-
- protected function collectSelectionResult($input,$output)
- {
- $indices=$input->SelectedIndices;
- $result='';
- foreach($indices as $index)
- {
- $item=$input->Items[$index];
- $result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
- }
- if($result==='')
- $output->Text='Your selection is empty.';
- else
- $output->Text='Your selection is: '.$result;
- }
-
- public function DBDropDownList1Changed($sender,$param)
- {
- $this->collectSelectionResult($sender,$this->DBDropDownList1Result);
- }
-
- public function DBDropDownList2Changed($sender,$param)
- {
- $this->collectSelectionResult($sender,$this->DBDropDownList2Result);
- }
-
- public function DBDropDownList3Changed($sender,$param)
- {
- $this->collectSelectionResult($sender,$this->DBDropDownList3Result);
- }
-
- public function selectionChanged($sender,$param)
- {
- $this->collectSelectionResult($sender,$this->SelectionResult);
- }
-
- public function buttonClicked($sender,$param)
- {
- $this->collectSelectionResult($this->DropDownList1,$this->SelectionResult2);
- }
-}
-
+<?php
+
+class Home extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $data=array('item 1','item 2','item 3','item 4');
+ $this->DBDropDownList1->DataSource=$data;
+ $this->DBDropDownList1->dataBind();
+
+ $data=array('key 1'=>'item 1','key 2'=>'item 2',
+ 'key 3'=>'item 3','key 4'=>'item 4');
+ $this->DBDropDownList2->DataSource=$data;
+ $this->DBDropDownList2->dataBind();
+
+ $data=array(
+ array('id'=>'001','name'=>'John','age'=>31),
+ array('id'=>'002','name'=>'Mary','age'=>30),
+ array('id'=>'003','name'=>'Cary','age'=>20));
+ $this->DBDropDownList3->DataSource=$data;
+ $this->DBDropDownList3->dataBind();
+ }
+ }
+
+ protected function collectSelectionResult($input,$output)
+ {
+ $indices=$input->SelectedIndices;
+ $result='';
+ foreach($indices as $index)
+ {
+ $item=$input->Items[$index];
+ $result.="(Index: $index, Value: $item->Value, Text: $item->Text)";
+ }
+ if($result==='')
+ $output->Text='Your selection is empty.';
+ else
+ $output->Text='Your selection is: '.$result;
+ }
+
+ public function DBDropDownList1Changed($sender,$param)
+ {
+ $this->collectSelectionResult($sender,$this->DBDropDownList1Result);
+ }
+
+ public function DBDropDownList2Changed($sender,$param)
+ {
+ $this->collectSelectionResult($sender,$this->DBDropDownList2Result);
+ }
+
+ public function DBDropDownList3Changed($sender,$param)
+ {
+ $this->collectSelectionResult($sender,$this->DBDropDownList3Result);
+ }
+
+ public function selectionChanged($sender,$param)
+ {
+ $this->collectSelectionResult($sender,$this->SelectionResult);
+ }
+
+ public function buttonClicked($sender,$param)
+ {
+ $this->collectSelectionResult($this->DropDownList1,$this->SelectionResult2);
+ }
+}
+
?> \ No newline at end of file