summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.php
blob: ea6e9f1c9e607931678323dcf1091b692f969c4b (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
<?php

class PopulateActiveList extends TPage
{
	public function populate_list1($sender, $param)
	{
		$data = array('Hello', 'World', 'Prado');
		$this->list1->Items->clear();
		for($i = 0,$k=count($data); $i<$k; $i++)
		{
			$item = new TListItem($data[$i], $i);
			$this->list1->Items[] = $item;
		}
	}

	public function populate_list2($sender, $param)
	{
		$data = array('Hello', 'World', 'Prado');
		$this->list2->Items->clear();
		for($i = 0,$k=count($data); $i<$k; $i++)
		{
			$item = new TListItem($data[$i], $i);
			$this->list2->Items[] = $item;
		}
	}

	public function list_changed($sender, $param)
	{
		$text = $sender->SelectedItem ? $sender->SelectedItem->Text : 'Not selected';
		$this->label1->Text = $sender->ID . ': '.$text;
	}
}