Jump to content

Grouping attributes into tabs: Difference between revisions

From NusaATK
No edit summary
 
m clarifying whats for what
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{howto|advanced|Jorge Garifuna}}
== Summary ==
== Summary ==


The [[atkTabbedPane]] attribute allows addition of subtabs to forms.


The atkTabbedPane attribute allows addition of subtabs to forms.
Sections will create a node level tabbed pane. This how to is for tabs as an attribute. See: [[Grouping attributes]]


== Requirements ==
== Requirements ==


ATK 6.0+
ATK 6.0+


== Implementations ==
== Implementations ==


'''1. Include the attribute like you would any other attribute:'''
'''1. Include the attribute like you would any other attribute:'''
 
<syntaxhighlight lang="php">
useattrib("atktabbedpane");
useattrib("atktabbedpane");
 
</syntaxhighlight>
'''2. Add attributes to atkTabbedPane'''
'''2. Add attributes to atkTabbedPane'''


The general constructor of atkTabbedPane is:
The general constructor of atkTabbedPane is:
 
<syntaxhighlight lang="php">
atkTabbedPane (String $name, [Array $tabs = array()], int $flags)
atkTabbedPane (String $name, [Array $tabs = array()], int $flags)
</syntaxhighlight>
* String $name: The name of the attribute
* Array $tabs: The arrays looks like array("tabname1"=>array("attribname1","attribname2"),"tabname1"=>array(..),..)
* int $flags: The flags for this attribute


• String $name: The name of the attribute
• Array $tabs: The arrays looks like array("tabname1"=>array("attribname1,"attribname2),"tabname1"=>array(..),..)
• int $flags: The flags for this attribute
For example if we had a node with the following attributes:
For example if we had a node with the following attributes:


name
* name
age
* age
address
* address
comment
* comment


And we wanted to have name and age on a single subtab and address and comment on a separate subtab at the same level, we would use atkTabbedPane as follows:
And we wanted to have name and age on a single subtab and address and comment on a separate subtab at the same level, we would use atkTabbedPane as follows:
<syntaxhighlight lang="php">
$this->add(new atkTabbedPane("mySubTab", array("name_age"=>array("name","age"), "add_com"=>array("address","comment")) ));
</syntaxhighlight>
'''3. Test'''
If everything was done correctly, when we refresh the node, we should see two subtabs: name_age with attributes name and age and subtab add_com with address and comment attributes.


$this->add(new atkTabbedPane("mySubTab", array("name_age"=>array("name",”age”), "add_com"=>array("address",”comment”)) ));
== FAQ ==


'''3. Test'''
<strong>How do I remove the tab label? and How do I make the tab set extend "full width"?</strong>


If everything was done correctly, when we refresh the node, we should see two subtabs: name_age with attributes name and age and subtab add_com with address and comment attributes.
Check out the [[ATK Attribute Flags]] AF_NO_LABEL and AF_BLANK_LABEL


Until next time,
== Contact ==


Jorge Garifuna
Jorge Garifuna
[http://www.GariSoft.com]
http://www.GariSoft.com

Latest revision as of 10:10, 7 December 2008

ATK Howto: Grouping attributes into tabs

Complexity: advanced
Author: Jorge Garifuna

List of other Howto's

Summary

The atkTabbedPane attribute allows addition of subtabs to forms.

Sections will create a node level tabbed pane. This how to is for tabs as an attribute. See: Grouping attributes

Requirements

ATK 6.0+

Implementations

1. Include the attribute like you would any other attribute:

useattrib("atktabbedpane");

2. Add attributes to atkTabbedPane

The general constructor of atkTabbedPane is:

atkTabbedPane (String $name, [Array $tabs = array()], int $flags)
  • String $name: The name of the attribute
  • Array $tabs: The arrays looks like array("tabname1"=>array("attribname1","attribname2"),"tabname1"=>array(..),..)
  • int $flags: The flags for this attribute

For example if we had a node with the following attributes:

  • name
  • age
  • address
  • comment

And we wanted to have name and age on a single subtab and address and comment on a separate subtab at the same level, we would use atkTabbedPane as follows:

$this->add(new atkTabbedPane("mySubTab", array("name_age"=>array("name","age"), "add_com"=>array("address","comment")) ));

3. Test

If everything was done correctly, when we refresh the node, we should see two subtabs: name_age with attributes name and age and subtab add_com with address and comment attributes.

FAQ

How do I remove the tab label? and How do I make the tab set extend "full width"?

Check out the ATK Attribute Flags AF_NO_LABEL and AF_BLANK_LABEL

Contact

Jorge Garifuna http://www.GariSoft.com