Since 3.0
Accordion is a container component that displays content in a stacked format.
<ace:accordion paneChangeListener="#{accordionPanelDynamicBean.onPaneChange}" ...>
<ace:accordionPane title="Electronic Devices" ...>
......
</ace:accordionPane>
<ace:accordionPane title="Cars" ...>
......
</ace:accordionPane>
<ace:accordionPane title="Food" ...>
......
</ace:accordionPane>
</ace:accordion>
TagLib Documentation
This section covers attributes involved in the typical use-cases for this component.
activeIndex sets the active pane, zero-based.
collapsible defines if accordion can be collapsed all together.
effect supports standard jQuery effects.
event is the client side event to toggle the panes: "click" or "mouseover".
To listen to pane change events, use paneChangeListener to designate a listener. Subsequent component render updates can be specified with onPaneChangeUpdate.
paneChangeListener
Server side listener to invoke when active pane changes.
panechange
Fired when the active accordion pane is changed (default event).
The client side component object is exposed through the global variable name specified in the widgetVar attribute.
The "widgetVar" attribute on the ACE components has been removed in ICEfaces 4 and in its place a new "ice.ace.instance()" client JavaScript object lookup API has been introduced. The reason for this change is to enable lazy-initialization of the ACE component JavaScript objects to improve runtime performance and reduce browser memory use.
var widget = ice.ace.instance('frm:componentId);
The ice.ace.instance function requires the full client id of the component to be specified, such as "j_idt77:componentId" instead of just "componentId". To reduce the complexity of working with complete IDs with this function it may be preferable in some cases to use
prependId="false"in the enclosing form (e.g. <h:form prependId="false">).
This component doesn't have a client-side API made specifically to be used by application developers. However, the component's internal methods and variables can be accessed in this way, including the underlying jQuery object and objects from underlying Javascript libraries (if applicable), and can be used for whatever purpose a developer might have in mind.
The following ARIA roles are supported: tablist, tab, tabpanel.
Keyboard interaction is supported when the accordion is focused and works by pressing the space or enter keys on the highlighted pane to open/close it and using the arrow keys to move up or down across the panes.
The following markup represents the basic HTML structure of the component and the CSS classes it uses.
<!-- Root container -->
<div class="[user defined classes]" style="[user defined styles]">
<!-- Panes container -->
<div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
<!-- Pane header -->
<h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">
<!-- Arrow icon -->
<span class="ui-icon ui-icon-triangle-1-e"></span>
<a>Pane title</a>
</h3>
<!-- Pane content -->
<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
<div>
</div>
</div>
</div>
</div>
None.