<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>xlab-6 experiments</title>
	<link>http://xlab6.com</link>
	<description>Prado development notes, musings, and tips.</description>
	<pubDate>Tue, 02 Oct 2007 02:32:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0</generator>
	<language>en</language>
			<item>
		<title>Prado PHP5 VMWare Image</title>
		<link>http://xlab6.com/prado-php5-vmware-image/</link>
		<comments>http://xlab6.com/prado-php5-vmware-image/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 02:32:22 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>php</category>
	<category>3.1</category>
		<guid isPermaLink="false">http://xlab6.com/prado-php5-vmware-image/</guid>
		<description><![CDATA[<p>
A virtual appliance (VWMare image ) with an installation of Prado 3.1 and the following components is now available.
</p>


<ul>
<li class="level1"><span class="li"><acronym title="Hypertext Preprocessor">PHP</acronym> 5.2.3 (in fast-cgi mode)</span></li>
<li class="level1"><span class="li">Lighttpd 1.4.7 (mod_rewrite and fast-cgi enable)</span></li>
<li class="level1"><span class="li">Prado 3.1 (including demos)</span></li>
<li class="level1"><span class="li">PostgreSQL 8.2.4</span></li>
<li class="level1"><span class="li">phpPgAdmin 4.1.3</span></li>
<li class="level1"><span class="li">Linux kernel 2.6.17.7</span></li>
</ul>


<p>
The appliance also contains networking tools such as ssh, dhcp, scp, etc. The appliance contains 2 disk images, the server disk is mounted as read-only while the data disk can grow to 4Gb.
</p>
<p>
This virtual appliance is a great way to demonstrate Prado 3.1, or functional testing, or even as an development platform.
</p>
<p>
<a href="http://xlab6.com/Prado-3.1.7z" class="urlextern" target="_blank" title="http://xlab6.com/Prado-3.1.7z">Download Prado PHP5 Virtual Appliance</a> (9.45 Mb).
</p>
<p>
The virtual appliance image is compressed using <a href="http://www.7-zip.org/download.html" class="urlextern" target="_blank" title="http://www.7-zip.org/download.html">7-Zip</a>, and a <a href="http://www.vmware.com/download/player/" class="urlextern" target="_blank" title="http://www.vmware.com/download/player/">VMWare player</a> or server is required to load the image.
</p>
<p>
The login credentials are <code>admin:admin</code> for all areas that requires authentication (e.g. server login, database, cache).
</p>
]]></description>
			<content:encoded><![CDATA[<p>
A virtual appliance (VWMare image ) with an installation of Prado 3.1 and the following components is now available.
</p>


<ul>
<li class="level1"><span class="li"><acronym title="Hypertext Preprocessor">PHP</acronym> 5.2.3 (in fast-cgi mode)</span></li>
<li class="level1"><span class="li">Lighttpd 1.4.7 (mod_rewrite and fast-cgi enable)</span></li>
<li class="level1"><span class="li">Prado 3.1 (including demos)</span></li>
<li class="level1"><span class="li">PostgreSQL 8.2.4</span></li>
<li class="level1"><span class="li">phpPgAdmin 4.1.3</span></li>
<li class="level1"><span class="li">Linux kernel 2.6.17.7</span></li>
</ul>


<p>
The appliance also contains networking tools such as ssh, dhcp, scp, etc. The appliance contains 2 disk images, the server disk is mounted as read-only while the data disk can grow to 4Gb.
</p>
<p>
This virtual appliance is a great way to demonstrate Prado 3.1, or functional testing, or even as an development platform.
</p>
<p>
<a href="http://xlab6.com/Prado-3.1.7z" class="urlextern" target="_blank" title="http://xlab6.com/Prado-3.1.7z">Download Prado PHP5 Virtual Appliance</a> (9.45 Mb).
</p>
<p>
The virtual appliance image is compressed using <a href="http://www.7-zip.org/download.html" class="urlextern" target="_blank" title="http://www.7-zip.org/download.html">7-Zip</a>, and a <a href="http://www.vmware.com/download/player/" class="urlextern" target="_blank" title="http://www.vmware.com/download/player/">VMWare player</a> or server is required to load the image.
</p>
<p>
The login credentials are <code>admin:admin</code> for all areas that requires authentication (e.g. server login, database, cache).
</p></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/prado-php5-vmware-image/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Redo of Prado Blog Tutorial Videos</title>
		<link>http://xlab6.com/redo-of-prado-blog-tutorial-videos/</link>
		<comments>http://xlab6.com/redo-of-prado-blog-tutorial-videos/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 01:42:42 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>php</category>
	<category>example</category>
	<category>3.1</category>
	<category>screen cast</category>
		<guid isPermaLink="false">http://xlab6.com/redo-of-prado-blog-tutorial-videos/</guid>
		<description><![CDATA[<p>
The complete <a href="http://www.pradosoft.com/demos/blog-tutorial/" class="urlextern" target="_blank" title="http://www.pradosoft.com/demos/blog-tutorial/">Prado blog tutorial</a> is now updated. Split over 6 videos to a sum of about 60 mins in total.  Flash plugin is required.
</p>


<ul>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=0" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=0">Day 1 - Creating a Contact Page</a> [8:02 (4.6 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=1" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=1">Day 2 - Setup Database</a> [4:36 (3.9 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=2" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=2">Day 3 (a) - Authentication and Authorization</a> [10:42  (4.5 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=3" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=3">Day 3 (b) - Create and Edit Users</a> [9:09 (6.1 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=4" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=4">Day 4 - Create, Edit and Read Posts</a> [23:10 (9.9 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=5" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=5">Day 5 - Refactoring and Deployment</a> [6:45 (4.2 Mb)]</span></li>
</ul>


<p>
Days 3 (b) and Day 4 diverts from the original tutorial to use the <a href="http://www.pradosoft.com/demos/quickstart/?page=Database.Scaffold" class="urlextern" target="_blank" title="http://www.pradosoft.com/demos/quickstart/?page=Database.Scaffold">Active Record Scaffold</a> to speed up the development.
</p>
<p>
You can also <a href="http://xlab6.com/video/blog-tutorial.zip" class="urlextern" target="_blank" title="http://xlab6.com/video/blog-tutorial.zip">download the videos (24 Mb)</a> to view at your own time.
</p>
<p>
There is currently no narration at the moment, but transcripts are available if you would volunteer your voice. <img src="/smileys/icon_wink.gif" 
align="top" style="margin-top:2px;" alt=";-)" />
</p>
<p>
PS. The text editor used in the screen case is <a href="http://intype.info/home/index.php" class="urlextern" target="_blank" title="http://intype.info/home/index.php">Intype</a> which is currently free (may be not so later when the complete it). The <a href="http://xlab6.com/Prado-intype.zip" class="urlextern" target="_blank" title="http://xlab6.com/Prado-intype.zip">Prado bundle for Intype and the theme used in the screen cast</a> are also available.
</p>
]]></description>
			<content:encoded><![CDATA[<p>
The complete <a href="http://www.pradosoft.com/demos/blog-tutorial/" class="urlextern" target="_blank" title="http://www.pradosoft.com/demos/blog-tutorial/">Prado blog tutorial</a> is now updated. Split over 6 videos to a sum of about 60 mins in total.  Flash plugin is required.
</p>


<ul>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=0" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=0">Day 1 - Creating a Contact Page</a> [8:02 (4.6 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=1" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=1">Day 2 - Setup Database</a> [4:36 (3.9 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=2" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=2">Day 3 (a) - Authentication and Authorization</a> [10:42  (4.5 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=3" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=3">Day 3 (b) - Create and Edit Users</a> [9:09 (6.1 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=4" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=4">Day 4 - Create, Edit and Read Posts</a> [23:10 (9.9 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://www.xlab6.com/video/blog-tutorial/?movie=5" class="urlextern" target="_blank" title="http://www.xlab6.com/video/blog-tutorial/?movie=5">Day 5 - Refactoring and Deployment</a> [6:45 (4.2 Mb)]</span></li>
</ul>


<p>
Days 3 (b) and Day 4 diverts from the original tutorial to use the <a href="http://www.pradosoft.com/demos/quickstart/?page=Database.Scaffold" class="urlextern" target="_blank" title="http://www.pradosoft.com/demos/quickstart/?page=Database.Scaffold">Active Record Scaffold</a> to speed up the development.
</p>
<p>
You can also <a href="http://xlab6.com/video/blog-tutorial.zip" class="urlextern" target="_blank" title="http://xlab6.com/video/blog-tutorial.zip">download the videos (24 Mb)</a> to view at your own time.
</p>
<p>
There is currently no narration at the moment, but transcripts are available if you would volunteer your voice. <img src="/smileys/icon_wink.gif" 
align="top" style="margin-top:2px;" alt=";-)" />
</p>
<p>
PS. The text editor used in the screen case is <a href="http://intype.info/home/index.php" class="urlextern" target="_blank" title="http://intype.info/home/index.php">Intype</a> which is currently free (may be not so later when the complete it). The <a href="http://xlab6.com/Prado-intype.zip" class="urlextern" target="_blank" title="http://xlab6.com/Prado-intype.zip">Prado bundle for Intype and the theme used in the screen cast</a> are also available.
</p></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/redo-of-prado-blog-tutorial-videos/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Prado video tutorials</title>
		<link>http://xlab6.com/prado-video-tutorials/</link>
		<comments>http://xlab6.com/prado-video-tutorials/#comments</comments>
		<pubDate>Sat, 12 May 2007 02:21:40 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>example</category>
	<category>screen cast</category>
		<guid isPermaLink="false">http://xlab6.com/prado-video-tutorials/</guid>
		<description><![CDATA[<p>
Here are some screen casts following the blog tutorial demos included in the Prado 3.1 Release Candiate (the demo that is, not the videos).
</p>


<ul>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day1/" class="urlextern" target="_blank" title="http://xlab6.com/video/day1/">Blog tutorial day 1</a> [10 mins (4.8 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day2/" class="urlextern" target="_blank" title="http://xlab6.com/video/day2/">Blog tutorial day 2</a> [4.5 mins (2.4 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day3a/" class="urlextern" target="_blank" title="http://xlab6.com/video/day3a/">Blog tutorial day 3 part 1</a> [8 mins (3.8 Mb)]</span></li>
</ul>


<p>
In addition, the following is a demonstration of Prado&#8217;s Active Record and Scaffold components.
</p>


<ul>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/address-book/" class="urlextern" target="_blank" title="http://xlab6.com/video/address-book/">Address book scaffold</a> [4.5 mins (2.4 Mb)]</span></li>
</ul>
]]></description>
			<content:encoded><![CDATA[<p>
Here are some screen casts following the blog tutorial demos included in the Prado 3.1 Release Candiate (the demo that is, not the videos).
</p>


<ul>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day1/" class="urlextern" target="_blank" title="http://xlab6.com/video/day1/">Blog tutorial day 1</a> [10 mins (4.8 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day2/" class="urlextern" target="_blank" title="http://xlab6.com/video/day2/">Blog tutorial day 2</a> [4.5 mins (2.4 Mb)]</span></li>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/day3a/" class="urlextern" target="_blank" title="http://xlab6.com/video/day3a/">Blog tutorial day 3 part 1</a> [8 mins (3.8 Mb)]</span></li>
</ul>


<p>
In addition, the following is a demonstration of Prado&#8217;s Active Record and Scaffold components.
</p>


<ul>
<li class="level1"><span class="li"><a href="http://xlab6.com/video/address-book/" class="urlextern" target="_blank" title="http://xlab6.com/video/address-book/">Address book scaffold</a> [4.5 mins (2.4 Mb)]</span></li>
</ul></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/prado-video-tutorials/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Vertical Image Alignment Using CSS (Firefox and IE)</title>
		<link>http://xlab6.com/vertical-align-image-using-css-firefox-and-ie/</link>
		<comments>http://xlab6.com/vertical-align-image-using-css-firefox-and-ie/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 04:19:07 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>css</category>
		<guid isPermaLink="false">http://xlab6.com/vertical-align-image-using-css-firefox-and-ie/</guid>
		<description><![CDATA[<p>
Here is a quick way to centre an image within a &lt;div&gt; box using only <acronym title="Cascading Style Sheets">CSS</acronym> (and using css <u>expression</u> for Internet Explorer).
</p>

<pre class="html"><span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html&gt;</span></a></span>
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>Vertical Image Alignment<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/style.html"><span class="kw2">&lt;style</span></a> <span class="kw3">type</span>=<span class="st0">"text/css"</span><span class="kw2">&gt;</span></a></span>
.content
{
    width: 100px;
    height: 100px;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    border: 1px solid red;
}
&nbsp;
.content img
{
    margin-top: expression((100 - this.height)/2);
}
    <span class="sc2"><span class="kw2">&lt;/style&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span>
&nbsp;
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body&gt;</span></a></span>
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"content"</span><span class="kw2">&gt;</span></a></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/img.html"><span class="kw2">&lt;img</span></a> <span class="kw3">src</span>=<span class="st0">"images/thumb3.jpg"</span> /<span class="kw2">&gt;</span></a></span>
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></pre>

<p>
The <u>.content</u> class creates a box of width 100&#215;100 pixels. We set the <strong>display</strong> property to <u>table-cell</u> and take advantage of the <strong>vertical-align</strong> property available for table cell (this works in browsers such as Firefox) to center the image vertical in the box. Unfortunately, Internet Explorer versions up to 7 does not support <u>display: table-cell</u>. However, we can use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp" class="urlextern" target="_blank" title="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">dynamic CSS attributes</a> to set the <strong>margin-top</strong> property of the image.
</p>

<pre class="css"><span class="kw1">margin-top</span>: expression<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="nu0">100</span> - this.height<span class="br0">&#41;</span>/<span class="nu0">2</span><span class="br0">&#41;</span>;</pre>

<p>
The above code calculates the <strong>margin-top</strong> property to center vertically the image inside the box. The context of the <u><strong>this</strong></u> within the expression is the <acronym title="HyperText Markup Language">HTML</acronym> element of the <acronym title="Cascading Style Sheets">CSS</acronym> selector.
</p>
]]></description>
			<content:encoded><![CDATA[<p>
Here is a quick way to centre an image within a &lt;div&gt; box using only <acronym title="Cascading Style Sheets">CSS</acronym> (and using css <u>expression</u> for Internet Explorer).
</p>

<pre class="html"><span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html&gt;</span></a></span>
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>Vertical Image Alignment<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/style.html"><span class="kw2">&lt;style</span></a> <span class="kw3">type</span>=<span class="st0">"text/css"</span><span class="kw2">&gt;</span></a></span>
.content
{
    width: 100px;
    height: 100px;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    border: 1px solid red;
}
&nbsp;
.content img
{
    margin-top: expression((100 - this.height)/2);
}
    <span class="sc2"><span class="kw2">&lt;/style&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span>
&nbsp;
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body&gt;</span></a></span>
<span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"content"</span><span class="kw2">&gt;</span></a></span>
    <span class="sc2"><a target="_blank"  href="http://december.com/html/4/element/img.html"><span class="kw2">&lt;img</span></a> <span class="kw3">src</span>=<span class="st0">"images/thumb3.jpg"</span> /<span class="kw2">&gt;</span></a></span>
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span>
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></pre>

<p>
The <u>.content</u> class creates a box of width 100&#215;100 pixels. We set the <strong>display</strong> property to <u>table-cell</u> and take advantage of the <strong>vertical-align</strong> property available for table cell (this works in browsers such as Firefox) to center the image vertical in the box. Unfortunately, Internet Explorer versions up to 7 does not support <u>display: table-cell</u>. However, we can use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp" class="urlextern" target="_blank" title="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">dynamic CSS attributes</a> to set the <strong>margin-top</strong> property of the image.
</p>

<pre class="css"><span class="kw1">margin-top</span>: expression<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="nu0">100</span> - this.height<span class="br0">&#41;</span>/<span class="nu0">2</span><span class="br0">&#41;</span>;</pre>

<p>
The above code calculates the <strong>margin-top</strong> property to center vertically the image inside the box. The context of the <u><strong>this</strong></u> within the expression is the <acronym title="HyperText Markup Language">HTML</acronym> element of the <acronym title="Cascading Style Sheets">CSS</acronym> selector.
</p></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/vertical-align-image-using-css-firefox-and-ie/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Screencast: Using PDO with data grid.</title>
		<link>http://xlab6.com/screencast-using-pdo-with-data-grid/</link>
		<comments>http://xlab6.com/screencast-using-pdo-with-data-grid/#comments</comments>
		<pubDate>Fri, 08 Sep 2006 00:16:08 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>example</category>
	<category>3.0</category>
	<category>screen cast</category>
		<guid isPermaLink="false">http://xlab6.com/screencast-using-pdo-with-data-grid/</guid>
		<description><![CDATA[<p>
Here is a very <a href="http://xlab6.com/assets/chapter2/chapter2.html" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter2/chapter2.html">basic introduction to retreiving some data from a MySQL</a> database using <a href="http://wiki.cc/php/PDO_Basics" class="urlextern" target="_blank" title="http://wiki.cc/php/PDO_Basics">PDO</a> and displaying the results in a data grid. The tutorial starts assuming that you have downloaded and unpacked the <a href="http://www.pradosoft.com/download/" class="urlextern" target="_blank" title="http://www.pradosoft.com/download/">Prado distribution</a>.
</p>
<p>
The tutorial is meant for the quickest introduction in retreiving data. Generally, you will need to refactor the code such that the logic of retrieving data is moved away from the TPage classses.
</p>
<p>
Screencast details:
</p>

<ul>
<li class="level2"><span class="li">length: approx ~ 3.5 mins (1.5 Mb)</span></li>
<li class="level2"><span class="li">format: flash 7 or later</span></li>
<li class="level2"><span class="li"><a href="http://xlab6.com/assets/chapter2/chapter2.swf" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter2/chapter2.swf">download swf</a> (1.5Mb)</span></li>
</ul>


<p>
Comments and suggestions most welcome.
</p>
]]></description>
			<content:encoded><![CDATA[<p>
Here is a very <a href="http://xlab6.com/assets/chapter2/chapter2.html" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter2/chapter2.html">basic introduction to retreiving some data from a MySQL</a> database using <a href="http://wiki.cc/php/PDO_Basics" class="urlextern" target="_blank" title="http://wiki.cc/php/PDO_Basics">PDO</a> and displaying the results in a data grid. The tutorial starts assuming that you have downloaded and unpacked the <a href="http://www.pradosoft.com/download/" class="urlextern" target="_blank" title="http://www.pradosoft.com/download/">Prado distribution</a>.
</p>
<p>
The tutorial is meant for the quickest introduction in retreiving data. Generally, you will need to refactor the code such that the logic of retrieving data is moved away from the TPage classses.
</p>
<p>
Screencast details:
</p>

<ul>
<li class="level2"><span class="li">length: approx ~ 3.5 mins (1.5 Mb)</span></li>
<li class="level2"><span class="li">format: flash 7 or later</span></li>
<li class="level2"><span class="li"><a href="http://xlab6.com/assets/chapter2/chapter2.swf" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter2/chapter2.swf">download swf</a> (1.5Mb)</span></li>
</ul>


<p>
Comments and suggestions most welcome.
</p></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/screencast-using-pdo-with-data-grid/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Prado Time Tracker Demo</title>
		<link>http://xlab6.com/prado-time-tracker-demo/</link>
		<comments>http://xlab6.com/prado-time-tracker-demo/#comments</comments>
		<pubDate>Sat, 29 Jul 2006 00:28:03 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>example</category>
	<category>javascript</category>
	<category>3.1</category>
		<guid isPermaLink="false">http://xlab6.com/prado-time-tracker-demo/</guid>
		<description><![CDATA[<p>
A new demo that utilises many of Prado&#8217;s features has been added to the trunk.  The Time Tracker is a business web application for keeping track of hours spent on a project, with ability to handle multiple resources as well as multiple projects.
</p>
<p>
The time tracker sample application have the following key features:
</p>


<ul>
<li class="level2"><span class="li">Define project information like due dates, hours to complete, project resources, and more.</span></li>
<li class="level2"><span class="li">Track time spent each day by category and project.</span></li>
<li class="level2"><span class="li">Generate progress and team resource reports across multiple projects.</span></li>
</ul>


<p>
The Time Tracker is based on the <a href="http://www.asp.net/downloads/starterkits/" class="urlextern" target="_blank" title="http://www.asp.net/downloads/starterkits/">ASP.NET's Time Tracker Starter Kit</a>
</p>
<p>
See the Prado demo <a href="http://xlab6.com/p3/demos/time-tracker/" class="urlextern" target="_blank" title="http://xlab6.com/p3/demos/time-tracker/">http://xlab6.com/p3/demos/time-tracker/</a>
</p>
<p>
<!-- SECTION [0-11] --></p>
<a name="technologies_and_design_approached_demonstrated"></a><h3 class='wiki'>Technologies and Design Approached Demonstrated</h3><div class="level3">



<ul>
<li class="level2"><span class="li">Prado event-driven component framework</span></li>
<li class="level2"><span class="li">Separation of concerns: persistent storage, business logic, presentation</span></li>
<li class="level2"><span class="li">Object-Relational mapping using SQLMap</span></li>
<li class="level2"><span class="li">Unit testing and functional testing</span></li>
<li class="level2"><span class="li">Promote code reuse</span></li>
</ul>


<p>
The demo is available in the daily snapshots from <a href="http://www.pradosoft.com/download/" class="urlextern" target="_blank" title="http://www.pradosoft.com/download/">Prado's download page</a>, or via SVN (see instructions from the download page).
</p>

<!-- SECTION [12-] --></div>
]]></description>
			<content:encoded><![CDATA[<p>
A new demo that utilises many of Prado&#8217;s features has been added to the trunk.  The Time Tracker is a business web application for keeping track of hours spent on a project, with ability to handle multiple resources as well as multiple projects.
</p>
<p>
The time tracker sample application have the following key features:
</p>


<ul>
<li class="level2"><span class="li">Define project information like due dates, hours to complete, project resources, and more.</span></li>
<li class="level2"><span class="li">Track time spent each day by category and project.</span></li>
<li class="level2"><span class="li">Generate progress and team resource reports across multiple projects.</span></li>
</ul>


<p>
The Time Tracker is based on the <a href="http://www.asp.net/downloads/starterkits/" class="urlextern" target="_blank" title="http://www.asp.net/downloads/starterkits/">ASP.NET's Time Tracker Starter Kit</a>
</p>
<p>
See the Prado demo <a href="http://xlab6.com/p3/demos/time-tracker/" class="urlextern" target="_blank" title="http://xlab6.com/p3/demos/time-tracker/">http://xlab6.com/p3/demos/time-tracker/</a>
</p>
<p>
<!-- SECTION [0-11] --></p>
<a name="technologies_and_design_approached_demonstrated"></a><h3 class='wiki'>Technologies and Design Approached Demonstrated</h3><div class="level3">



<ul>
<li class="level2"><span class="li">Prado event-driven component framework</span></li>
<li class="level2"><span class="li">Separation of concerns: persistent storage, business logic, presentation</span></li>
<li class="level2"><span class="li">Object-Relational mapping using SQLMap</span></li>
<li class="level2"><span class="li">Unit testing and functional testing</span></li>
<li class="level2"><span class="li">Promote code reuse</span></li>
</ul>


<p>
The demo is available in the daily snapshots from <a href="http://www.pradosoft.com/download/" class="urlextern" target="_blank" title="http://www.pradosoft.com/download/">Prado's download page</a>, or via SVN (see instructions from the download page).
</p>

<!-- SECTION [12-] --></div></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/prado-time-tracker-demo/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Unit and Functional Test tools in Prado.</title>
		<link>http://xlab6.com/unit-and-functional-test-tools-in-prado/</link>
		<comments>http://xlab6.com/unit-and-functional-test-tools-in-prado/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 01:23:17 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>php</category>
	<category>example</category>
	<category>3.0</category>
	<category>screen cast</category>
		<guid isPermaLink="false">http://xlab6.com/unit-and-functional-test-tools-in-prado/</guid>
		<description><![CDATA[<p>
Many of Prado&#8217;s web controls are testing using a web functional test based on combination of <a href="http://www.openqa.org/selenium/" class="urlextern" target="_blank" title="http://www.openqa.org/selenium/">Selenium</a> and <a href="http://www.lastcraft.com/simple_test.php" class="urlextern" target="_blank" title="http://www.lastcraft.com/simple_test.php">SimpleTest</a>. Here is an <a href="http://xlab6.com/assets/chapter1/chapter1.html" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter1/chapter1.html">screencast example of creating a unit test case and a functional web test case</a>.
</p>
<p>
Screencast details:
</p>

<ul>
<li class="level2"><span class="li">length: approx ~ 4 mins (3 Mb)</span></li>
<li class="level2"><span class="li">format: flash 7 or later</span></li>
<li class="level2"><span class="li"><a href="http://xlab6.com/assets/chapter1/chapter1.swf" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter1/chapter1.swf">download swf</a> (3Mb)</span></li>
</ul>
]]></description>
			<content:encoded><![CDATA[<p>
Many of Prado&#8217;s web controls are testing using a web functional test based on combination of <a href="http://www.openqa.org/selenium/" class="urlextern" target="_blank" title="http://www.openqa.org/selenium/">Selenium</a> and <a href="http://www.lastcraft.com/simple_test.php" class="urlextern" target="_blank" title="http://www.lastcraft.com/simple_test.php">SimpleTest</a>. Here is an <a href="http://xlab6.com/assets/chapter1/chapter1.html" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter1/chapter1.html">screencast example of creating a unit test case and a functional web test case</a>.
</p>
<p>
Screencast details:
</p>

<ul>
<li class="level2"><span class="li">length: approx ~ 4 mins (3 Mb)</span></li>
<li class="level2"><span class="li">format: flash 7 or later</span></li>
<li class="level2"><span class="li"><a href="http://xlab6.com/assets/chapter1/chapter1.swf" class="urlextern" target="_blank" title="http://xlab6.com/assets/chapter1/chapter1.swf">download swf</a> (3Mb)</span></li>
</ul></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/unit-and-functional-test-tools-in-prado/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>ActiveControls: Callback Calculator example</title>
		<link>http://xlab6.com/activecontrols-callback-calculator-example/</link>
		<comments>http://xlab6.com/activecontrols-callback-calculator-example/#comments</comments>
		<pubDate>Sat, 06 May 2006 10:29:26 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>example</category>
	<category>3.0</category>
	<category>active control</category>
		<guid isPermaLink="false">http://xlab6.com/activecontrols-callback-calculator-example/</guid>
		<description><![CDATA[<p>
An <a href="http://xlab6.com/example/activesample.php?page=Calculator" class="urlextern" target="_blank" title="http://xlab6.com/example/activesample.php?page=Calculator">AJAX calculator example for Prado v2.1x</a> was done a few months ago. The same can now be done in Prado v3 using the latests code from the <a href="http://trac.pradosoft.com/browser/trunk" class="urlextern" target="_blank" title="http://trac.pradosoft.com/browser/trunk">SVN trunk</a>.
</p>
<p>
To begin, we create the template with 3 textboxes and a button. Save the template file as, say, <u>Calculator.page</u>
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:TForm</span><span class="re3">&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"a"</span> <span class="re3">/&gt;</span></span>
+
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"b"</span> <span class="re3">/&gt;</span></span>
=
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"c"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TActiveButton</span> ID=<span class="st0">"sum"</span>
                OnClick=<span class="st0">"calculate_sum"</span> Text=<span class="st0">"Calculate!"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;/<span class="re1">com:TForm</span><span class="re3">&gt;</span></span></pre>

<p>
The corresponding <u>Calculator.php</u> file is very simple.
</p>

<pre class="php"><span class="kw2">&lt;?php</span>
<span class="co1">//include the active controls namespace</span>
Prado::<span class="me2">using</span><span class="br0">&#40;</span><span class="st0">'System.Web.UI.ActiveControls.*'</span><span class="br0">&#41;</span>;
<span class="kw2">class</span> Calculator extends TPage
<span class="br0">&#123;</span>
    public <span class="kw2">function</span> calculate_sum<span class="br0">&#40;</span><span class="re0">$sender</span>, <span class="re0">$param</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
         <span class="re0">$a</span> = <a target="_blank"  href="http://www.php.net/floatval"><span class="kw3">floatval</span></a><span class="br0">&#40;</span><span class="re0">$this</span>-&gt;<span class="me1">a</span>-&gt;<span class="me1">Text</span><span class="br0">&#41;</span>;
         <span class="re0">$b</span> = <a target="_blank"  href="http://www.php.net/floatval"><span class="kw3">floatval</span></a><span class="br0">&#40;</span><span class="re0">$this</span>-&gt;<span class="me1">b</span>-&gt;<span class="me1">Text</span><span class="br0">&#41;</span>;
         <span class="re0">$this</span>-&gt;<span class="me1">c</span>-&gt;<span class="me1">Text</span> = <span class="re0">$a</span> + <span class="re0">$b</span>;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
<span class="kw2">?&gt;</span></pre>

<p>
That&#8217;s all there is to it, run the application from your browser. The calculator <strong>will function normally if javascript is disabled</strong>. We can also add some validators to ensure that both summand are entered before calcuating the sum. To do this, we simply add two validators and a summary to <u>Calculator.page</u>.
</p>

<pre class="template"><span class="sc3">&lt;<span class="re0">com:TForm</span><span class="re3">&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"a"</span> <span class="re3">/&gt;</span></span>
+
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"b"</span> <span class="re3">/&gt;</span></span>
=
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"c"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TActiveButton</span> ID=<span class="st0">"sum"</span>
                OnClick=<span class="st0">"calculate_sum"</span> Text=<span class="st0">"Calculate!"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TRequiredFieldValidator</span>
                ControlToValidate=<span class="st0">"a"</span>
                ErrorMessage=<span class="st0">"left summand is required."</span>
                Display=<span class="st0">"None"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TRequiredFieldValidator</span>
                ControlToValidate=<span class="st0">"b"</span>
                ErrorMessage=<span class="st0">"right summand is requied."</span>
                Display=<span class="st0">"None"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TValidationSummary</span>
                ID=<span class="st0">"summary"</span>
                HeaderText=<span class="st0">"Unable to calculate because"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;/<span class="re1">com:TForm</span><span class="re3">&gt;</span></span></pre>

<p>
The resulting <a href="http://xlab6.com/p3/tests/FunctionalTests/features/?page=ActiveControls.Calculator" class="urlextern" target="_blank" title="http://xlab6.com/p3/tests/FunctionalTests/features/?page=ActiveControls.Calculator">calculator example</a> will utilize javascript if available and remain functional if javascript is unavailable.
</p>
]]></description>
			<content:encoded><![CDATA[<p>
An <a href="http://xlab6.com/example/activesample.php?page=Calculator" class="urlextern" target="_blank" title="http://xlab6.com/example/activesample.php?page=Calculator">AJAX calculator example for Prado v2.1x</a> was done a few months ago. The same can now be done in Prado v3 using the latests code from the <a href="http://trac.pradosoft.com/browser/trunk" class="urlextern" target="_blank" title="http://trac.pradosoft.com/browser/trunk">SVN trunk</a>.
</p>
<p>
To begin, we create the template with 3 textboxes and a button. Save the template file as, say, <u>Calculator.page</u>
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:TForm</span><span class="re3">&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"a"</span> <span class="re3">/&gt;</span></span>
+
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"b"</span> <span class="re3">/&gt;</span></span>
=
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"c"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TActiveButton</span> ID=<span class="st0">"sum"</span>
                OnClick=<span class="st0">"calculate_sum"</span> Text=<span class="st0">"Calculate!"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;/<span class="re1">com:TForm</span><span class="re3">&gt;</span></span></pre>

<p>
The corresponding <u>Calculator.php</u> file is very simple.
</p>

<pre class="php"><span class="kw2">&lt;?php</span>
<span class="co1">//include the active controls namespace</span>
Prado::<span class="me2">using</span><span class="br0">&#40;</span><span class="st0">'System.Web.UI.ActiveControls.*'</span><span class="br0">&#41;</span>;
<span class="kw2">class</span> Calculator extends TPage
<span class="br0">&#123;</span>
    public <span class="kw2">function</span> calculate_sum<span class="br0">&#40;</span><span class="re0">$sender</span>, <span class="re0">$param</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
         <span class="re0">$a</span> = <a target="_blank"  href="http://www.php.net/floatval"><span class="kw3">floatval</span></a><span class="br0">&#40;</span><span class="re0">$this</span>-&gt;<span class="me1">a</span>-&gt;<span class="me1">Text</span><span class="br0">&#41;</span>;
         <span class="re0">$b</span> = <a target="_blank"  href="http://www.php.net/floatval"><span class="kw3">floatval</span></a><span class="br0">&#40;</span><span class="re0">$this</span>-&gt;<span class="me1">b</span>-&gt;<span class="me1">Text</span><span class="br0">&#41;</span>;
         <span class="re0">$this</span>-&gt;<span class="me1">c</span>-&gt;<span class="me1">Text</span> = <span class="re0">$a</span> + <span class="re0">$b</span>;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
<span class="kw2">?&gt;</span></pre>

<p>
That&#8217;s all there is to it, run the application from your browser. The calculator <strong>will function normally if javascript is disabled</strong>. We can also add some validators to ensure that both summand are entered before calcuating the sum. To do this, we simply add two validators and a summary to <u>Calculator.page</u>.
</p>

<pre class="template"><span class="sc3">&lt;<span class="re0">com:TForm</span><span class="re3">&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"a"</span> <span class="re3">/&gt;</span></span>
+
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"b"</span> <span class="re3">/&gt;</span></span>
=
<span class="sc3">&lt;<span class="re0">com:TActiveTextBox</span> ID=<span class="st0">"c"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TActiveButton</span> ID=<span class="st0">"sum"</span>
                OnClick=<span class="st0">"calculate_sum"</span> Text=<span class="st0">"Calculate!"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TRequiredFieldValidator</span>
                ControlToValidate=<span class="st0">"a"</span>
                ErrorMessage=<span class="st0">"left summand is required."</span>
                Display=<span class="st0">"None"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TRequiredFieldValidator</span>
                ControlToValidate=<span class="st0">"b"</span>
                ErrorMessage=<span class="st0">"right summand is requied."</span>
                Display=<span class="st0">"None"</span> <span class="re3">/&gt;</span></span>
&nbsp;
<span class="sc3">&lt;<span class="re0">com:TValidationSummary</span>
                ID=<span class="st0">"summary"</span>
                HeaderText=<span class="st0">"Unable to calculate because"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;/<span class="re1">com:TForm</span><span class="re3">&gt;</span></span></pre>

<p>
The resulting <a href="http://xlab6.com/p3/tests/FunctionalTests/features/?page=ActiveControls.Calculator" class="urlextern" target="_blank" title="http://xlab6.com/p3/tests/FunctionalTests/features/?page=ActiveControls.Calculator">calculator example</a> will utilize javascript if available and remain functional if javascript is unavailable.
</p></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/activecontrols-callback-calculator-example/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Creating new Prado components by template composition</title>
		<link>http://xlab6.com/creating-new-prado-components-by-template-composition/</link>
		<comments>http://xlab6.com/creating-new-prado-components-by-template-composition/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 11:33:32 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>php</category>
	<category>example</category>
	<category>3.0</category>
		<guid isPermaLink="false">http://xlab6.com/creating-new-prado-components-by-template-composition/</guid>
		<description><![CDATA[<p>
<strong>Update (28/4/2006): </strong> You must extend <u>TCompositeControl</u> abstract class rather than <u>TTemplateControl</u>.
</p>
<p>
One of the easiest method of creating a new custom component is by template composition. For example, suppose we want to create a labelled textbox component, that is, a textbox component with a label attached. Let us call this new component <code>LabeledTextBox</code>.
</p>
<p>
First, create the template for the new proposed component and save the file as <u>LabeledTextBox.tpl</u><a href="#fn1" name="fnt1" class="fn_top">1)</a>.
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:TLabel</span> ID=<span class="st0">"label"</span> ForControl=<span class="st0">"textbox"</span> Text=<span class="st0">"label:"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TTextBox</span> ID=<span class="st0">"textbox"</span> <span class="re3">/&gt;</span></span></pre>

<p>
Second, we eed a <acronym title="Hypertext Preprocessor">PHP</acronym> class to expose the textbox and label properties. Component with templates must extend the <code>TCompositeControl</code> class. Save the <acronym title="Hypertext Preprocessor">PHP</acronym> file as <u>LabeledTextBox.php</u>.
</p>
<pre class="php"><span class="kw2">&lt;?php</span>
&nbsp;
<span class="kw2">class</span> LabeledTextBox extends TCompositeControl
<span class="br0">&#123;</span>
    <span class="coMULTI">/**
     * @return TTextBox textbox instance
     */</span>
    public <span class="kw2">function</span> getTextBox<span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">textbox</span>;
    <span class="br0">&#125;</span>
&nbsp;
    <span class="coMULTI">/**
     * @return TLabel textbox label
     */</span>
    public <span class="kw2">function</span> getLabel<span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">label</span>;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw2">?&gt;</span></pre>

<p>
That completes the custom component definition. If you have saved the about code to a certain directory, you must include them in the namespace before using them.
</p>

<p>
Finally, the usage of this new component is very simple, just use them like all other components.
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:LabeledTextBox</span> Label.Text=<span class="st0">"username:"</span> <span class="re3">/&gt;</span></span><span class="sc3">&lt;br <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:LabeledTextBox</span> Label.Text=<span class="st0">"password:"</span> <span class="re3">/&gt;</span></span></pre>

<p>
Notice that <code>Label.Text</code> is a sub-property, where the <code>Label</code> property belongs to <code>LabeledTextBox</code> and corresponds to the <code>getLabel()</code> function. The sub-property (or property of another property) <code>Text</code> is a property of <code>TLabel</code> component.
</p>
<p>
The addition of sub-properties in Prado v3 makes component template composition really simple and effective. So, try it and create some new custom component by grouping together your oftened used components through template composition.
</p>

<div class="footnotes"><div class="fn"><a href="#fnt1" name="fn1" class="fn_bot">1)</a> Component templates have <code>.tpl</code> file extension by default.</div></div>
]]></description>
			<content:encoded><![CDATA[<p>
<strong>Update (28/4/2006): </strong> You must extend <u>TCompositeControl</u> abstract class rather than <u>TTemplateControl</u>.
</p>
<p>
One of the easiest method of creating a new custom component is by template composition. For example, suppose we want to create a labelled textbox component, that is, a textbox component with a label attached. Let us call this new component <code>LabeledTextBox</code>.
</p>
<p>
First, create the template for the new proposed component and save the file as <u>LabeledTextBox.tpl</u><a href="#fn1" name="fnt1" class="fn_top">1)</a>.
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:TLabel</span> ID=<span class="st0">"label"</span> ForControl=<span class="st0">"textbox"</span> Text=<span class="st0">"label:"</span> <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:TTextBox</span> ID=<span class="st0">"textbox"</span> <span class="re3">/&gt;</span></span></pre>

<p>
Second, we eed a <acronym title="Hypertext Preprocessor">PHP</acronym> class to expose the textbox and label properties. Component with templates must extend the <code>TCompositeControl</code> class. Save the <acronym title="Hypertext Preprocessor">PHP</acronym> file as <u>LabeledTextBox.php</u>.
</p>
<pre class="php"><span class="kw2">&lt;?php</span>
&nbsp;
<span class="kw2">class</span> LabeledTextBox extends TCompositeControl
<span class="br0">&#123;</span>
    <span class="coMULTI">/**
     * @return TTextBox textbox instance
     */</span>
    public <span class="kw2">function</span> getTextBox<span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">textbox</span>;
    <span class="br0">&#125;</span>
&nbsp;
    <span class="coMULTI">/**
     * @return TLabel textbox label
     */</span>
    public <span class="kw2">function</span> getLabel<span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">label</span>;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw2">?&gt;</span></pre>

<p>
That completes the custom component definition. If you have saved the about code to a certain directory, you must include them in the namespace before using them.
</p>

<p>
Finally, the usage of this new component is very simple, just use them like all other components.
</p>
<pre class="template"><span class="sc3">&lt;<span class="re0">com:LabeledTextBox</span> Label.Text=<span class="st0">"username:"</span> <span class="re3">/&gt;</span></span><span class="sc3">&lt;br <span class="re3">/&gt;</span></span>
<span class="sc3">&lt;<span class="re0">com:LabeledTextBox</span> Label.Text=<span class="st0">"password:"</span> <span class="re3">/&gt;</span></span></pre>

<p>
Notice that <code>Label.Text</code> is a sub-property, where the <code>Label</code> property belongs to <code>LabeledTextBox</code> and corresponds to the <code>getLabel()</code> function. The sub-property (or property of another property) <code>Text</code> is a property of <code>TLabel</code> component.
</p>
<p>
The addition of sub-properties in Prado v3 makes component template composition really simple and effective. So, try it and create some new custom component by grouping together your oftened used components through template composition.
</p>

<div class="footnotes"><div class="fn"><a href="#fnt1" name="fn1" class="fn_bot">1)</a> Component templates have <code>.tpl</code> file extension by default.</div></div></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/creating-new-prado-components-by-template-composition/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>New TDatePicker for Prado v3.0</title>
		<link>http://xlab6.com/new-datepicker-for-prado-v30/</link>
		<comments>http://xlab6.com/new-datepicker-for-prado-v30/#comments</comments>
		<pubDate>Fri, 20 Jan 2006 07:20:08 +0000</pubDate>
		<dc:creator>Wei</dc:creator>
		
	<category>prado</category>
	<category>3.0</category>
	<category>javascript</category>
		<guid isPermaLink="false">http://xlab6.com/new-tdatepicker-for-prado-v30/</guid>
		<description><![CDATA[A new client-side javascript date picker in Prado v3.0.]]></description>
			<content:encoded><![CDATA[<p>
Since Prado 1.0 the TDatePicker component used the feature rich javascript calendar from <a href="http://www.dynarch.com/projects/calendar/" class="urlextern" target="_blank" title="http://www.dynarch.com/projects/calendar/">http://www.dynarch.com/projects/calendar/</a>. There are a few problems with this calendar, namely, it was difficult to localized (i.e., a calendar in your own language).
</p>
<p>
<strong> Example:</strong>  see <a href="http://xlab6.com/prado3/tests/FunctionalTests/tests.php?page=UI.DatePicker" class="urlextern" target="_blank" title="http://xlab6.com/prado3/tests/FunctionalTests/tests.php?page=UI.DatePicker">the functional test for the date picker</a>.
</p>
<p>
So for Prado v3.0 a new client-side calendar or date picker was written. It was written long before v3.0 began, during the v2.0 days. It was inspired from the <a href="http://www.koders.com/javascript/fidD551E3FCA59E61757F513CE847E4428E5C7918DC.aspx" class="urlextern" target="_blank" title="http://www.koders.com/javascript/fidD551E3FCA59E61757F513CE847E4428E5C7918DC.aspx">Taperstry's date picker</a>, and more recent <a href="http://www.frequency-decoder.com/2005/10/14/unobtrusive-date-picker-widgit" class="urlextern" target="_blank" title="http://www.frequency-decoder.com/2005/10/14/unobtrusive-date-picker-widgit">Unobtrusive Date-Picker Widgit</a>.
</p>
<p>
Here are the features for the new TDatePicker for Prado v3.0
</p>


<ul>
<li class="level1"><span class="li">Lite weight, well compared to more featured one ;)</span></li>
<li class="level1"><span class="li">No additional localization necessary, uses existing I18N data from <a href="http://icu.sourceforge.net/" class="urlextern" target="_blank" title="http://icu.sourceforge.net/">ICU</a></span></li>
<li class="level1"><span class="li">Keyboard navigation, see below</span></li>
<li class="level1"><span class="li">Works in <acronym title="Internet Explorer">IE</acronym> and Firefox, unsure about others</span></li>
</ul>



<a name="keyboard_access"></a><h4 class='wiki'>Keyboard access</h4><div class="level4">



<ul>
<li class="level1"><span class="li"><code>Left</code>, <code>Right</code>, <code>Up</code>, <code>Down</code> = day navigation (these are the arrow keys)</span></li>
<li class="level1"><span class="li"><code>Ctrl or Shift + Up</code> = next year</span></li>
<li class="level1"><span class="li"><code>Ctrl or Shift + Down</code> = previous year</span></li>
<li class="level1"><span class="li"><code>Ctrl or Shift + Right</code> = next month</span></li>
<li class="level1"><span class="li"><code>Ctrl or Left</code> = previous month</span></li>
<li class="level1"><span class="li"><code>Esc</code> = close date-picker (no date selected)</span></li>
<li class="level1"><span class="li"><code>Return</code> = select highlighted date and close date-picker</span></li>
</ul>


<p>
Usage in Prado v3.0 is similar to the v2.x, e.g.
</p>
<pre class="template">   <span class="sc3">&lt;<span class="re0">com:TDatePicker</span> <span class="re3">/&gt;</span></span></pre>

<p>
Have fun!
</p>



</div></p>
]]></content:encoded>
			<wfw:commentRSS>http://xlab6.com/new-datepicker-for-prado-v30/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
