blob: 413e7185e47bbdc109db68b8320c06e9a4c2671c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<?php
class ActiveDropDownList extends TPage
{
function list1_changed($sender)
{
$this->label1->setText("Selection 1: ".$sender->getSelectedValue());
$this->addOptionsToList2($sender->getSelectedValue());
}
function addOptionsToList2($parent)
{
for($i = 0; $i < 5; $i++)
$this->list2->Items[$i] = $parent.' - item '.($i+1);
$this->list2->setEnabled(true);
}
function list2_changed($sender)
{
$this->label2->setText("Selection 2: ".$sender->getSelectedValue());
}
function select_index_3()
{
$this->list1->setSelectedIndex(3);
}
function clear_selections()
{
$this->list1->clearSelection();
}
function select_value_2()
{
$this->list1->setSelectedValue("value 2");
}
function select_index_3_plus()
{
$this->list1->setSelectedValue("value 3");
$this->list1_changed($this->list1);
$this->list2->setSelectedValue("value 3 - item 3");
}
function do_postback()
{
$value = 'List 1: '.$this->list1->selectedValue. ', List 2: '. $this->list2->selectedValue;
$this->label1->Text = $value;
}
}
|