summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
diff options
context:
space:
mode:
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
index 3835d3c3..5dfa3bba 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php
@@ -4,18 +4,26 @@ class Home extends TPage
{
public function selectionChanged($sender,$param)
{
- $index=$sender->SelectedIndex;
- $value=$sender->SelectedValue;
- $text=$sender->SelectedItem->Text;
- $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ if(($index=$sender->SelectedIndex)>=0)
+ {
+ $value=$sender->SelectedValue;
+ $text=$sender->SelectedItem->Text;
+ $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ }
+ else
+ $this->SelectionResult->Text="Your selection is empty.";
}
public function buttonClicked($sender,$param)
{
- $index=$this->ListBox1->SelectedIndex;
- $value=$this->ListBox1->SelectedValue;
- $text=$this->ListBox1->SelectedItem->Text;
- $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ if(($index=$this->ListBox1->SelectedIndex)>=0)
+ {
+ $value=$this->ListBox1->SelectedValue;
+ $text=$this->ListBox1->SelectedItem->Text;
+ $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text).";
+ }
+ else
+ $this->SelectionResult2->Text="Your selection is empty.";
}
}