summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActivePanel.php
diff options
context:
space:
mode:
authorwei <>2006-06-17 01:55:05 +0000
committerwei <>2006-06-17 01:55:05 +0000
commitb3ceed048bb533a00bbea542f7c12b49c8c83d9b (patch)
tree97962fc3cb6746ae404c4f1d0095834bbb0e1ac7 /framework/Web/UI/ActiveControls/TActivePanel.php
parent6c0154fb4e292ad22667e618f598a37cc5f9d524 (diff)
Update changes to active controls, add FT tests for active controls, add comments.
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActivePanel.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActivePanel.php50
1 files changed, 47 insertions, 3 deletions
diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php
index db1d8a7d..787b65d3 100644
--- a/framework/Web/UI/ActiveControls/TActivePanel.php
+++ b/framework/Web/UI/ActiveControls/TActivePanel.php
@@ -1,9 +1,37 @@
<?php
-/*
- * Created on 5/05/2006
+/**
+ * TActivePanel file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version : :
+ * @package System.Web.UI.ActiveControls
*/
-class TActivePanel extends TPanel
+/**
+ * TActivePanel is the TPanel active control counterpart.
+ *
+ * TActivePanel allows the client-side panel contents to be updated during a
+ * callback response using the {@link flush} method.
+ *
+ * Example: Assume $param is an instance of TCallbackEventParameter attached to
+ * the OnCallback event a TCallback with ID "callback1", and
+ * "panel1" is the ID of a TActivePanel.
+ * <code>
+ * function callback1_requested($sender, $param)
+ * {
+ * $this->panel1->flush($param->getOutput());
+ * }
+ * </code>
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @version $Revision: $ Sun Jun 18 01:23:54 EST 2006 $
+ * @package System.Web.UI.ActiveControls
+ * @since 3.0
+ */
+class TActivePanel extends TPanel implements IActiveControl
{
/**
* Creates a new callback control, sets the adapter to
@@ -16,10 +44,26 @@ class TActivePanel extends TPanel
$this->setAdapter(new TActiveControlAdapter($this));
}
+ /**
+ * @return TBaseActiveControl standard active control options.
+ */
public function getActiveControl()
{
return $this->getAdapter()->getBaseActiveControl();
}
+
+ /**
+ * Renders and replaces the panel's content on the client-side.
+ * @param THtmlWriter html writer
+ */
+ public function flush($writer)
+ {
+ if($this->getActiveControl()->canUpdateClientSide())
+ {
+ $this->render($writer);
+ $this->getPage()->getCallbackClient()->replaceContent($this,$writer);
+ }
+ }
}
?> \ No newline at end of file