3 * TFlushOutput class file
5 * @author Berczi Gabor <gabor.berczi@devworx.hu>
6 * @link http://www.pradosoft.com/
7 * @license http://www.pradosoft.com/license/
8 * @version $Id: TFlushOutput.php $
9 * @package System.Web.UI.WebControls
15 * TFlushOutput enables forced flushing of the current output buffer
16 * at (a) certain point(s) in the page, after rendering of all previous
17 * controls has been completed.
19 * To use TFlushOutput, simply place it in a template where you want
20 * the have the output buffered between the start of the page or the
21 * last TFlushOutput to be sent to the client immediately
23 * <com:TFlushOutput />
26 * You can specify whether you want to keep buffering of the output
27 * (if it was enabled) till the next occourence of a <com: TFlushOutput />
28 * or the end of the page rendering, or stop buffering, by using the
29 * {@link setContinueBuffering ContinueBuffering}.
31 * @author Berczi Gabor <gabor.berczi@devworx.hu>
32 * @version $Id: TFlushOutput.php $
33 * @package System.Web.UI.WebControls
36 class TFlushOutput extends TControl
39 * @var boolean whether to continue buffering of output
41 private $_continueBuffering=true;
47 public function __construct()
49 parent::__construct();
50 $this->EnableViewState = false;
54 * @return Tells whether buffering of output can continue after this point
56 public function getContinueBuffering()
58 return $this->_continueBuffering;
62 * @param boolean sets whether buffering of output can continue after this point
64 public function setContinueBuffering($value)
66 $this->_continueBuffering = TPropertyValue::ensureBoolean($value);
70 * Flushes the output of all completely rendered controls to the client.
71 * @param THtmlWriter writer for the rendering purpose
73 public function render($writer)
75 //$writer->write('<!-- flush -->');
76 // ajax responses can't be parsed by the client side before loaded and returned completely,
77 // so don't bother with flushing output somewhere mid-page if refreshing in a callback
78 if (!$this->Page->IsCallback)
80 $this->Page->flushWriter();
81 // $this->Application->flushOutput($this->ContinueBuffering);