<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mark Wiesemann &#187; Tableless renderer</title>
	<atom:link href="http://www.markwiesemann.eu/category/pear/tableless-renderer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markwiesemann.eu</link>
	<description></description>
	<lastBuildDate>Sun, 15 Aug 2010 15:57:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using the tableless renderer together with HTML_QuickForm_Controller</title>
		<link>http://www.markwiesemann.eu/2007/12/23/using-the-tableless-renderer-together-with-html_quickform_controller/</link>
		<comments>http://www.markwiesemann.eu/2007/12/23/using-the-tableless-renderer-together-with-html_quickform_controller/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 16:32:39 +0000</pubDate>
		<dc:creator>Mark Wiesemann</dc:creator>
				<category><![CDATA[Tableless renderer]]></category>

		<guid isPermaLink="false">http://www.markwiesemann.eu/2007/12/23/using-the-tableless-renderer-together-with-html_quickform_controller/</guid>
		<description><![CDATA[My post &#8220;Combining DHTMLRules, tableless layout and multiple page forms with HTML_QuickForm&#8221; led to several inqueries about why the layout with the shown code snippets still uses tables. The answer is: One needs to tell HTML_QuickForm_Controller (QFC) about the usage of another renderer. To achieve this, three basic steps are needed: Step 1: Include the [...]]]></description>
			<content:encoded><![CDATA[<p>My post &#8220;<a href="http://www.markwiesemann.eu/2007/03/29/combining-dhtmlrules-tableless-layout-and-multiple-page-forms-with-html_quickform/#comment-4942">Combining DHTMLRules, tableless layout and multiple page forms with HTML_QuickForm</a>&#8221; led to several inqueries about why the layout with the shown code snippets still uses tables. The answer is: One needs to tell HTML_QuickForm_Controller (QFC) about the usage of another renderer.<br />
<span id="more-28"></span><br />
To achieve this, three basic steps are needed:</p>
<p>Step 1: Include the code of the tableless renderer.</p>
<pre class="brush: php; title: ; notranslate">
require_once 'HTML/QuickForm/Renderer/Tableless.php';
</pre>
<p>Step 2: Create a new class that extends from the HTML_QuickForm_Action_Display class, and overload the _renderForm() method. This method basically does the same as the code examples for the single page forms do. The only difference is the usage of $page instead of $form (a page in QFC extends the HTML_QuickForm class).</p>
<pre class="brush: php; title: ; notranslate">
class Tableless_Display extends HTML_QuickForm_Action_Display
{
    function _renderForm(&amp;$page)
    {
        $renderer =&amp; new HTML_QuickForm_Renderer_Tableless();
        $page-&gt;accept($renderer);
        echo $renderer-&gt;toHtml();
    }
}
</pre>
<p>Step 3: Tell QFC to use the new class instead of the default HTML_QuickForm_Action_Display class for displaying the form. ($wizard is a HTML_QuickForm_Controller instance in this example.)</p>
<pre class="brush: php; title: ; notranslate">
$wizard-&gt;addAction('display', new Tableless_Display());
</pre>
<p>After these three steps, you should have a tableless layout together with DHTML rules.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markwiesemann.eu/2007/12/23/using-the-tableless-renderer-together-with-html_quickform_controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combining DHTMLRules, tableless layout and multiple page forms with HTML_QuickForm</title>
		<link>http://www.markwiesemann.eu/2007/03/29/combining-dhtmlrules-tableless-layout-and-multiple-page-forms-with-html_quickform/</link>
		<comments>http://www.markwiesemann.eu/2007/03/29/combining-dhtmlrules-tableless-layout-and-multiple-page-forms-with-html_quickform/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 16:51:45 +0000</pubDate>
		<dc:creator>Mark Wiesemann</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Tableless renderer]]></category>

		<guid isPermaLink="false">http://www.markwiesemann.eu/2007/03/29/combining-dhtmlrules-tableless-layout-and-multiple-page-forms-with-html_quickform/</guid>
		<description><![CDATA[With the new 0.3.0 release of HTML_QuickForm_DHTMLRulesTableless it is now possible to build forms with HTML_QuickForm that have the following features: tableless layout (no &#60;table&#62; tags, very good accessibility) DHTMLRules (form elements errors are shown on top of each element) more than one page To achieve such forms, four PEAR package are needed: HTML_QuickForm HTML_QuickForm_Controller [...]]]></description>
			<content:encoded><![CDATA[<p>With the new <a href="http://pear.php.net/package/HTML_QuickForm_DHTMLRulesTableless/download/0.3.0">0.3.0 release</a> of <a href="http://pear.php.net/package/HTML_QuickForm_DHTMLRulesTableless">HTML_QuickForm_DHTMLRulesTableless</a> it is now possible to build forms with HTML_QuickForm that have the following features:</p>
<ul>
<li>tableless layout (no &lt;table&gt; tags, very good accessibility)</li>
<li>DHTMLRules (form elements errors are shown on top of each element)</li>
<li>more than one page</li>
</ul>
<p><span id="more-26"></span><br />
To achieve such forms, four PEAR package are needed:</p>
<ul>
<li><a href="http://pear.php.net/package/HTML_QuickForm">HTML_QuickForm</a></li>
<li><a href="http://pear.php.net/package/HTML_QuickForm_Controller">HTML_QuickForm_Controller</a></li>
<li><a href="http://pear.php.net/package/HTML_QuickForm_Renderer_Tableless">HTML_QuickForm_Renderer_Tableless</a></li>
<li><a href="http://pear.php.net/package/HTML_QuickForm_DHTMLRulesTableless">HTML_QuickForm_DHTMLRulesTableless</a></li>
</ul>
<p>Information about building forms with HTML_QuickForm, about building multiple page forms with HTML_QuickForm_Controller, about using the tableless renderer, and about using the DHTMLRulesTableless class on forms built with HTML_QuickForms can be found in the <a href="http://pear.php.net/manual/">PEAR manual</a>. The only thing that I&#8217;ll explain here is the usage of DHTMLRulesTableless class with HTML_QuickForm_Controller.</p>
<p>In general, a form page is added like in the following code snippet:</p>
<pre class="brush: php; title: ; notranslate">
class Page1 extends HTML_QuickForm_Page
{
    // ...
}
$form =&amp; new HTML_QuickForm_Controller();
$page1 =&amp; new Page1('page1');
$form-&gt;addPage($page1);
</pre>
<p>To use now the DHTMLRulesTableless class, you need to add and to change one line:</p>
<pre class="brush: php; title: ; notranslate">
require_once 'HTML/QuickForm/PageDHTMLRulesTableless.php';
class Page1 extends HTML_QuickForm_PageDHTMLRulesTableless
{
    // ...
}
$form =&amp; new HTML_QuickForm_Controller();
$page1 =&amp; new Page1('page1');
$form-&gt;addPage($page1);
</pre>
<p>That means that you only need to do two things:</p>
<ul>
<li>you need to include HTML/QuickForm/PageDHTMLRulesTableless.php</li>
<li>instead of extending from HTML_QuickForm_Page, your page classes need to extend from HTML_QuickForm_PageDHTMLRulesTableless</li>
</ul>
<p>The new HTML_QuickForm_PageDHTMLRulesTableless class is mostly a simple copy of the HTML_QuickForm_DHTMLRulesTableless class, but it extends HTML_QuickForm_Page and not HTML_QuickForm. This code duplication couldn&#8217;t be avoided because of a bad design of the Page class of HTML_QuickForm_Controller. After HTML_QuickForm2 is ready, a new Controller package is planned, and <a href="http://pear.php.net/user/avb">Alexey Borzov</a> already announced that his new package will have a better design to avoid the need of such code duplications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markwiesemann.eu/2007/03/29/combining-dhtmlrules-tableless-layout-and-multiple-page-forms-with-html_quickform/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Howto: Adding explanations next to form fields with Tableless QuickForm renderer</title>
		<link>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/</link>
		<comments>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 13:31:27 +0000</pubDate>
		<dc:creator>Mark Wiesemann</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Tableless renderer]]></category>

		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/</guid>
		<description><![CDATA[Today, a user of HTML_QuickForm_Renderer_Tableless asked how he can add explanations next to form fields. An example of such an explaination or additional information is shown in the following screenshot: To be able to add another text to an element, we will use a rather unknown feature of HTML_QuickForm. QuickForm supports multiple labels for elements. [...]]]></description>
			<content:encoded><![CDATA[<p>Today, a user of <a href="http://pear.php.net/package/HTML_QuickForm_Renderer_Tableless">HTML_QuickForm_Renderer_Tableless</a> asked how he can add explanations next to form fields. An example of such an explaination or additional information is shown in the following screenshot:<br />
<img id="image18" src="http://www.markwiesemann.eu/wp-content/uploads/2006/12/twolabel.png" alt="Usage of two labels with HTML_QuickForm_Renderer_Tableless" /></p>
<p><span id="more-20"></span></p>
<p>To be able to add another text to an element, we will use a rather unknown feature of <a href="http://pear.php.net/package/HTML_QuickForm">HTML_QuickForm</a>. QuickForm supports multiple labels for elements. Instead of using a string of the <code>$label</code> parameter, one can specify an array of strings with labels. For example, instead of</p>
<pre class="brush: php; title: ; notranslate">
$form-&gt;addElement('text', 'email', 'Your email:');
</pre>
<p>we can also write</p>
<pre class="brush: php; title: ; notranslate">
$form-&gt;addElement('text', 'email',
    array('Your email:',
          'Please check your email address twice.'));
</pre>
<p>The second step is to modify the template for form elements. The default element template is defined as follows:</p>
<pre class="brush: php; title: ; notranslate">
$elementTemplate =
&quot;\n\t\t\t&lt;li&gt;&lt;label class=\&quot;element\&quot;&gt;&lt;!-- BEGIN required
--&gt;&lt;span class=\&quot;required\&quot;&gt;*&lt;/span&gt;&lt;!-- END required --&gt;
{label}&lt;/label&gt;&lt;div class=\&quot;element&lt;!-- BEGIN error --&gt;
error&lt;!-- END error --&gt;\&quot;&gt;&lt;!-- BEGIN error --&gt;&lt;span
class=\&quot;error\&quot;&gt;{error}&lt;/span&gt;&lt;br /&gt;&lt;!-- END error --&gt;
{element}&lt;/div&gt;&lt;/li&gt;&quot;;
</pre>
<p>By adding</p>
<pre class="brush: php; title: ; notranslate">
&lt;!-- BEGIN label_2 --&gt;&lt;br /&gt;&lt;span style=\&quot;font-size: 80%;\&quot;&gt;
{label_2}&lt;/span&gt;&lt;!-- END label_2 --&gt;
</pre>
<p>after <code>{element}</code> we will now make the second label visible. Our new element template is now defined as follows:</p>
<pre class="brush: php; title: ; notranslate">
$elementTemplateTwoLabel =
&quot;\n\t\t\t&lt;li&gt;&lt;label class=\&quot;element\&quot;&gt;&lt;!-- BEGIN required
--&gt;&lt;span class=\&quot;required\&quot;&gt;*&lt;/span&gt;&lt;!-- END required --&gt;
{label}&lt;/label&gt;&lt;div class=\&quot;element&lt;!-- BEGIN error --&gt;
error&lt;!-- END error --&gt;\&quot;&gt;&lt;!-- BEGIN error --&gt;&lt;span
class=\&quot;error\&quot;&gt;{error}&lt;/span&gt;&lt;br /&gt;&lt;!-- END error --&gt;
{element}&lt;!-- BEGIN label_2 --&gt;&lt;br /&gt;&lt;span style=
\&quot;font-size: 80%;\&quot;&gt;{label_2}&lt;/span&gt;&lt;!-- END label_2 --&gt;
&lt;/div&gt;&lt;/li&gt;&quot;;
</pre>
<p>The third and last step is to change the element template in the renderer:</p>
<pre class="brush: php; title: ; notranslate">
$renderer-&gt;setElementTemplate($elementTemplateTwoLabel);
</pre>
<p>If you need the second label only for a single element, you can also specify the element name as the second parameter:</p>
<pre class="brush: php; title: ; notranslate">
$renderer-&gt;setElementTemplate($elementTemplateTwoLabel,
                              'elementName');
</pre>
<p>After reloading your modified script, you should get a similar output to the screensheet shown above.</p>
<p>Note: All linebreaks in the code snippets shown above are not required (in the templates they are even discouraged), they are just used to make the code readable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markwiesemann.eu/2006/12/27/howto-adding-explainations-next-to-form-fields-with-tableless-quickform-renderer/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>New Tableless renderer releases</title>
		<link>http://www.markwiesemann.eu/2006/12/04/new-tableless-renderer-releases/</link>
		<comments>http://www.markwiesemann.eu/2006/12/04/new-tableless-renderer-releases/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 22:08:51 +0000</pubDate>
		<dc:creator>Mark Wiesemann</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Tableless renderer]]></category>

		<guid isPermaLink="false">http://www.markwiesemann.eu/2006/12/12/new-tableless-renderer-releases/</guid>
		<description><![CDATA[New releases of both HTML_QuickForm_Renderer_Tableless (0.4.3) and HTML_QuickForm_DHTMLRulesTableless (0.2.3) are available. The renderer had only a little stylesheet change to achieve layout compatibility with Windows Internet Explorer 7. The DHTMLRules got support for multiple error messages (needed for groups), and there were some bug fixes. In the tableless renderer I have removed the &#8220;height: 1px;&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>New releases of both <a href="http://pear.php.net/package/HTML_QuickForm_Renderer_Tableless">HTML_QuickForm_Renderer_Tableless</a> (0.4.3) and <a href="http://pear.php.net/package/HTML_QuickForm_DHTMLRulesTableless">HTML_QuickForm_DHTMLRulesTableless</a> (0.2.3) are available. The renderer had only a little stylesheet change to achieve layout compatibility with Windows Internet Explorer 7. The DHTMLRules got support for multiple error messages (needed for groups), and there were some bug fixes.</p>
<p><span id="more-16"></span></p>
<p>In the tableless renderer I have removed the &#8220;height: 1px;&#8221; style from the &#8220;form fieldset li&#8221; block in the stylesheet to achieve layout compatibility with Windows Internet Explorer 7. This breaks layout compatibility with Firefox 1.x browsers, while Firefox 2.0 still works as expected. The <a href="http://pear.php.net/manual/en/package.html.html-quickform-renderer-tableless.faq.php">FAQ</a> in the PEAR manual contains solutions for getting Firefox 1.x compatibility back.</p>
<p>Besides two small changes, namely the adoption of the stylesheet changes from the renderer and changed escaping of the &lt;script&gt; tag for better compatibility with older browsers, the DHTMLRulesTableless got some bigger changes on the error style assignment and error message displaying.</p>
<p>In some cases the error style (i.e. the red border in the default stylesheet) and the error message were still shown even if the element was made valid; this was due to a bad concept for the lines of code that should decide whether the error style and message can be removed or not.</p>
<p>The last releases showed for every row of the form only the last error message. But, for groups of elements, there can be more than one error message at a time; now, all of these messages will be shown.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markwiesemann.eu/2006/12/04/new-tableless-renderer-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

