Creates a new tab and layout area in a ColdFusion tabbed layout.
ColdFusion.Layout.createTab(layout
,layoutArea
,Title
,URL
[,configObject
])
cflayout, cflayoutarea, ColdFusion.Layout.disableTab, ColdFusion.Layout.enableTab, ColdFusion.Layout.hideTab, ColdFusion.Layout.selectTab, ColdFusion.Layout.showTab, "Using layouts" in the ColdFusion Developer's Guide
ColdFusion 8: Added this function
Parameter |
Description |
---|---|
layout |
The name attribute of the tabbed layout in which to add the tab |
layoutArea |
The name to assign to the layout area that is created for the new tab. Must be unique on the page. |
title |
The text to display on the tab. You can use HTML mark-up to control the title appearance. |
URL |
The URL from which to get the layout area contents. This attribute can use URL parameters to pass data to the page. ColdFusion uses standard page path resolution rules to locate the page. |
configObject |
An object containing window configuration parameters. For details, see "Usage". |
This function does not return a value.
This function dynamically creates tabs in a tabbed layout; it is equivalent to putting a cflayoutarea tag inside a cflayout tag with a type attribute of tag. The configuration parameter defines tab characteristics; it can have any or all of the following entries:
Entry |
Default |
Description |
---|---|---|
align |
The cflayout tag align attribute value |
Specifies how to align child controls within the layout area. The following values are valid:
|
callbackhandler |
|
A function that will be called when the layout tab body has loaded. This function must not take any arguments. |
closable |
false |
A Boolean value specifying whether the user can close the window. If true, the tab has an X close icon. |
disabled |
false |
A Boolean value specifying whether the tab is disabled, that is, whether user can select the tab to display its contents. Disabled tabs are greyed out. Ignored if there is a true selected entry. |
errorhandler |
|
A function that will be called if an error occurs in loading the tab body. This function must take two arguments:
|
inithide |
false |
A Boolean value specifying whether the tab is initially hidden. To show an initially hidden tab, use the ColdFusion.Layout.showTab function. |
overflow |
auto |
Specifies how to display child content whose size would cause the tab layout area to overflow the window boundaries. The following values are valid:
Note: In Internet Explorer, layout areas with the visible setting expand to fit the size of the contents, rather than having the contents extend beyond the layout area. |
selected |
false |
A Boolean value specifying whether this tab is initially selected so that its contents appears in the layout. |
style |
|
A CSS style specification that controls the appearance of the layout area. |
The following example creates a tabbed layout with one tab. When you click the button it creates a second tab that is immediately visible and selected.
The main page looks as follows:
<html> <head> </head> <body> <cfform name="layouts"> <cfinput type="button" name="CreateTab" onClick="ColdFusion.Layout.createTab('tabLayout','tab2', 'Tab 2','_tabUrl.cfm',{inithide:false,selected:true})" value="Create Tab"> </cfform> <cflayout type="tab" name="tabLayout"> <cflayoutarea name="tab1" title="Tab 1" align="left"> Default Tab </cflayoutarea> </cflayout> </body> </html>
The _tabURL.cfm page looks as follows:
<h3>Tab 2</h3> This is a simple tab