summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/ActiveDropDownList.php
blob: 10541885375cf783bccd5ca5dc4b5278e680d82a (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
<?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->label1->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");
	}
}

?>