1: <?php
2: 3: 4: 5:
6:
7:
8: require('includes/configuration/prepend.inc.php');
9:
10: class SampleForm extends QForm {
11: protected $lblMessage;
12: protected $btnButton;
13:
14: protected function Form_Create() {
15: $this->lblMessage = new QLabel($this);
16: $this->lblMessage->Text = 'Click the button to change my message.';
17:
18: $this->btnButton = new QButton($this);
19: $this->btnButton->Text = 'Click Me';
20: $this->btnButton->AddAction(new QClickEvent(), new QServerAction('btnButton_Click'));
21: }
22:
23: protected function btnButton_Click($strFormId, $strControlId, $strParameter) {
24: $this->lblMessage->Text = 'Hello, World!';
25: }
26: }
27:
28: SampleForm::Run('SampleForm');