Simple tab controlled panel component. This component looks in the container message resource for an entry like label-panelid for inserting as panel title. If key not found the panel id inserted instead.
| Name | Type | Flags | Default | Default Prefix | Description |
|---|---|---|---|---|---|
| activePanelId | String | NOT Allow Null | prop | set the panel with given id as activated. | |
| clientId | String | NOT Allow Null | prop:componentResources.id | literal | The id used to generate a page-unique client-side identifier for the component. If a component renders multiple times, a suffix will be appended to the to id to ensure uniqueness. |
| panelIds | java.util.List | Required, NOT Allow Null | list | list of div id's (for each panel). | |
| update | String | NOT Allow Null | literal | Name of a function on the client-side Tapestry.ElementEffect object that is invoked after the Zone's content has been updated. If not specified, then the basic "highlight" method is used, which performs a classic "yellow fade" to indicate to the user that and update has taken place. |
here an example, how to use the TabSet component.
@Persist
@Property
private String activeBlock;
@Persist
@Property
private Date sysDate;
@Property
private List<String> blockIds;
@Property
@Inject
private MusicLibrary musicLibrary;
@Property
private Track track;
@Component(parameters = {"source=musicLibrary.tracks", "value=track"})
private PagedLoop pagedLoop;
void pageLoaded()
{
blockIds = new ArrayList<String>();
blockIds.add("stuff1");
blockIds.add("stuff2");
blockIds.add("stuff3");
blockIds.add("stuff4");
}
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body>
<div t:type"ck/tabset" panelIds="prop:blockIds" activePanelId="activeBlock"/>
<t:block id="stuff1">
<h3>Panel 1</h3>
<hr/>
content from block "stuff1"
</t:block>
<t:block id="stuff2">
<h3>Panel 2</h3>
<hr/>
<ul>
<li>
<strong>Album</strong>
<strong>Artist</strong>
<strong>Title</strong>
</li>
<li t:id="pagedLoop">
<span t:type="ck/TrimmedString" maxLength="40" value="track.album"/>
<span t:type="ck/TrimmedString" value="track.artist"/>
<span t:type="ck/TrimmedString" maxLength="40" value="track.title"/>
</li>
</ul>
</t:block>
<t:block id="stuff3">
<h3>Panel 3</h3>
<hr/>
content from block "stuff3"
</t:block>
<t:block id="stuff4">
<h3>Panel 4</h3>
<hr/>
<t:form>
<t:datefield value="sysDate"/>
<input type="submit"/>
</t:form>
</t:block>
</body>
</html>