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

class PostLoadingTest extends TPage
{
	public function onInit($param)
	{
		parent::onInit($param);

		// Text Box
		$textBox=new TTextBox();
		$textBox->setVisible(false);
		$textBox->setID("MyTextBox");
		$this->panel1->getControls()->add($textBox);
		$this->registerObject("MyTextBox", $textBox);


		// Submit button
		$button=new TActiveButton();
		$button->setVisible(false);
		$button->setID("MyButton");
		$button->setText("Submit");
		$button->attachEventHandler("OnCallback", array($this, "clickedButton"));
		$this->panel1->getControls()->add($button);
		$this->registerObject("MyButton", $button);

	}


	function callback1_requested($sender, $param)
	{
		$this->MyTextBox->visible = true;
		$this->MyButton->ActiveControl->EnableUpdate=false;
		$this->MyButton->visible = true;
		$this->panel1->render($param->NewWriter);
	}

	function clickedButton($sender, $param)
	{
		$this->panel1->getControls()->add('Result is '.$this->MyTextBox->getText());
		$this->panel1->render($param->NewWriter);
		$this->Page->CallbackClient->Highlight('heading');
	}
}

?>