1: <?php
2: require_once('../qcubed.inc.php');
3:
4: 5: 6: 7: 8: 9: 10: 11:
12:
13: class AjaxTimingForm extends QForm {
14: protected $txt1;
15: protected $lblTxt1Change;
16: protected $lblTxt1KeyUp;
17:
18: protected $chk;
19: protected $lblCheck;
20:
21: protected function Form_Create() {
22: $this->txt1 = new QTextBox($this, 'txtbox');
23: $this->txt1->Name = "TextBox Test";
24: $this->txt1->Text = "Change me";
25: $this->txt1->AddAction(new QChangeEvent(), new QAjaxAction('txtChange'));
26: $this->txt1->AddAction(new QKeyUpEvent(), new QAjaxAction('txtKeyUp'));
27:
28: $this->lblTxt1Change = new QLabel($this);
29: $this->lblTxt1Change->Name = "Value after Change";
30:
31: $this->lblTxt1KeyUp = new QLabel($this);
32: $this->lblTxt1KeyUp->Name = "Value after Key Up";
33:
34: $this->chk = new QCheckBox($this, 'chkbox');
35: $this->chk->Name = "Checkbox Text";
36: $this->chk->AddAction(new QClickEvent(), new QAjaxAction('chkChange'));
37: $this->lblCheck = new QLabel($this);
38: $this->lblCheck->Name = "Value after Click";
39: }
40:
41: protected function txtChange($strFormId, $strControlId, $strParameter) {
42: $this->lblTxt1Change->Text = $this->txt1->Text;
43: }
44:
45: protected function txtKeyUp($strFormId, $strControlId, $strParameter) {
46: $this->lblTxt1KeyUp->Text = $this->txt1->Text;
47: }
48:
49: protected function chkChange($strFormId, $strControlId, $strParameter) {
50: $this->lblCheck->Text = $this->chk->Checked;
51: }
52:
53: }
54: AjaxTimingForm::Run('AjaxTimingForm');
55: