diff options
author | wei <> | 2006-12-05 23:37:07 +0000 |
---|---|---|
committer | wei <> | 2006-12-05 23:37:07 +0000 |
commit | 33b2284955a8f0015922d4c69c5082141b584f27 (patch) | |
tree | e23b3805a8c1e3dd70076ae36d2e4733f11d56bc /tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php | |
parent | 176ee7e9b6c69cf42e7afeeb03db602237a49bc3 (diff) |
load the inlineeditor textbox in client side onload.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php')
-rw-r--r-- | tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php new file mode 100644 index 00000000..d31c10f6 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php @@ -0,0 +1,53 @@ +<?php
+
+class GerTurno2 extends TPage {
+
+ private $_turnos = null;
+
+
+ public function onLoad($param) {
+ parent::onLoad($param);
+
+ $this->loadTurnoOptions();
+
+ if (!$this->IsPostBack) {
+ $this->ativaModoEdicao();
+ }
+ }
+
+
+ protected function loadTurnoOptions()
+ {
+ $this->DDropTurno->DataTextField="descricao";
+ $this->DDropTurno->DataValueField="id";
+ $this->_turnos = array(
+ array('id' => 1, 'codigo'=>'test 1', 'descricao' => 'hello 1'),
+ array('id' => 2, 'codigo'=>'test 2', 'descricao' => 'hello 2')
+ );
+ $this->DDropTurno->setDataSource($this->_turnos);
+ $this->DDropTurno->dataBind();
+ }
+
+
+ protected function ativaModoEdicao() {
+ $this->loadDadosTurno($this->DDropTurno->getSelectedValue());
+ }
+
+
+ protected function loadDadosTurno($id) {
+ foreach ($this->_turnos as $key => $tur) {
+ if ($tur['id'] == $id) {
+ $this->Codigo->setText($tur['codigo']);
+ $this->Descricao->setText($tur['descricao']);
+ }
+ }
+ }
+
+
+ public function trocaTurno($sender,$param) {
+ $this->loadDadosTurno($sender->getSelectedValue());
+ }
+
+}
+
+?>
\ No newline at end of file |