summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
blob: 6b410eddd5427dd03694bf0a1149bef79a8b1711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/*
 * Created on 29/04/2006
 */

class TActiveControlAdapter extends TControlAdapter
{
	private static $_renderedPosts = false;
	
	/**
	 * Render the callback request post data loaders once only.
	 */
	public function render($writer)
	{
		if(!self::$_renderedPosts)
		{
			$options = TJavascript::encode($this->getPage()->getPostDataLoaders(),false);
			$script = "Prado.CallbackRequest.PostDataLoaders.concat({$options});";
			$this->getPage()->getClientScript()->registerEndScript(get_class($this), $script);
			self::$_renderedPosts = true;
		}
		parent::render($writer);
		if($this->getPage()->getIsCallback())
			$this->getPage()->getCallbackClient()->replace($this->getControl(), $writer);
	}	
} 
?>