<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>tab[ Search for &quot;&quot;]</title>
        <description></description>
        <link>http://xataface.com/wiki/index.php?-action=single_record_search&amp;-table=wiki&amp;page_id=%3D48&amp;-cursor=0&amp;-skip=0&amp;-limit=30&amp;-mode=list&amp;--subsearch=</link>
        <lastBuildDate>Sun, 19 May 2013 05:56:35 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>tab</title>
            <link>http://www.xataface.com/wiki/tab</link>
            <description>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page name&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;tab&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page id&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;48&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page title&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;tab&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Content&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;
&lt;h2 id=&quot;toc0&quot;&gt;tab directive of the fields.ini file&lt;/h2&gt;
&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;tr&gt;&lt;td&gt;
&lt;div id=&quot;toc&quot;&gt;&lt;strong&gt;Table of Contents&lt;/strong&gt;
	&lt;div style=&quot;margin-left: 0em;&quot;&gt;&lt;a href=&quot;#toc0&quot;&gt;tab directive of the fields.ini file&lt;/a&gt;&lt;/div&gt;
	&lt;div style=&quot;margin-left: 0em;&quot;&gt;&lt;a href=&quot;#toc1&quot;&gt;Example 1: Placing address info on separate tab&lt;/a&gt;&lt;/div&gt;
	&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc2&quot;&gt;Splitting form into tabs&lt;/a&gt;&lt;/div&gt;
	&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc3&quot;&gt;Customizing the tab labels&lt;/a&gt;&lt;/div&gt;
	&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc4&quot;&gt;Reordering the tabs&lt;/a&gt;&lt;/div&gt;
	&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#toc5&quot;&gt;Try This Example App&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;The &lt;em&gt;tab&lt;/em&gt; directive of the &lt;a href=&quot;/wiki/fields.ini_file&quot;&gt;fields.ini file&lt;/a&gt; specifies which tab of the record edit form a field should be displayed on.  Xataface supports multiple tabs on the edit form by way of this &lt;em&gt;tab&lt;/em&gt; directive.  If no fields contain the &lt;em&gt;tab&lt;/em&gt; directive then all fields are displayed in a single tab (named &lt;em&gt;__main__&lt;/em&gt;).&lt;/p&gt;


&lt;h2 id=&quot;toc1&quot;&gt;Example 1: Placing address info on separate tab&lt;/h2&gt;
&lt;p&gt;Consider the following &lt;em&gt;people&lt;/em&gt; table:  
&lt;pre&gt;&lt;code&gt;CREATE TABLE `people` (
    person_id int(11) not null auto_increment primary key,
    first_name varchar(32) not null,
    last_name varchar(32) not null,
    address varchar(100),
    city varchar(100),
    province varchar(100),
    country varchar(100),
    postal_code varchar(20)
)&lt;/code&gt;&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;We want to split the fields into two tabs: &lt;ul&gt;
    &lt;li&gt; Personal Info&lt;/li&gt;
    &lt;li&gt; Address Info&lt;/li&gt;
&lt;/ul&gt;

&lt;/p&gt;


&lt;h3 id=&quot;toc2&quot;&gt;Splitting form into tabs&lt;/h3&gt;
 We'll do this in two steps.  We use the &lt;em&gt;tab&lt;/em&gt; directive to assign all address-related fields to the &lt;em&gt;address_info&lt;/em&gt; tab.  In the tables/people/fields.ini file: 
&lt;pre&gt;&lt;code&gt;[address]
    tab=address_info

[city]
    tab=address_info

[province]
    tab=address_info

[country]
    tab=address_info

[postal_code]
    tab=address_info&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, when we load the edit form of the &lt;em&gt;people&lt;/em&gt; table, we see two tabs:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt; __main__&lt;/li&gt;
    &lt;li&gt; address_info&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;img src=&quot;http://media.weblite.ca/files/photos/Picture 9.png?max_width=640&quot;/&gt;
&lt;img src=&quot;http://media.weblite.ca/files/photos/Picture 10.png?max_width=640&quot;/&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;__main__&lt;/em&gt; is the name assigned to the default tab (for all fields that don't have a tab defined explicitly.&lt;/p&gt;


&lt;h3 id=&quot;toc3&quot;&gt;Customizing the tab labels&lt;/h3&gt;
&lt;p&gt;Next we will customize the tab labels by adding the following to the beginning of the &lt;a href=&quot;/wiki/fields.ini_file&quot;&gt;fields.ini file&lt;/a&gt;: 
&lt;pre&gt;&lt;code&gt;[tab:__main__]
    label=&amp;quot;Personal Information&amp;quot;

[tab:address_info]
    label=&amp;quot;Address Information&amp;quot;&lt;/code&gt;&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://media.weblite.ca/files/photos/Picture 11.png?max_width=640&quot;/&gt;
&lt;img src=&quot;http://media.weblite.ca/files/photos/Picture 12.png?max_width=640&quot;/&gt;
&lt;/p&gt;


&lt;h3 id=&quot;toc4&quot;&gt;Reordering the tabs&lt;/h3&gt;
&lt;p&gt;If we want to reorder the tabs so that the &lt;em&gt;address_info&lt;/em&gt; tab comes first, we would just reorder the definitions of the tabs: 
&lt;pre&gt;&lt;code&gt;[tab:address_info]
    label=&amp;quot;Address Information&amp;quot;

[tab:__main__]
    label=&amp;quot;Personal Information&amp;quot;&lt;/code&gt;&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://media.weblite.ca/files/photos/Picture 13.png?max_width=640&quot;/&gt;
&lt;/p&gt;


&lt;h3 id=&quot;toc5&quot;&gt;Try This Example App&lt;/h3&gt;
&lt;p&gt;You can try this tiny sample application out &lt;a href=&quot;http://dev.weblite.ca/tab_test&quot; onclick=&quot;window.open(this.href, '_blank'); return false;&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Language&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;en&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description>
            <author>tab</author>
        </item>
    </channel>
</rss>
