Accordion

Table of Contents

Overview

Since 3.0

Accordion is a container component that displays content in a stacked format.

See the ICEfaces Showcase Live Demo of this component, complete with source code.

Getting Started

                     <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>

Attributes

TagLib Documentation
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.

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.

Event Listeners

paneChangeListener Server side listener to invoke when active pane changes.

Client Behavior Events

panechange Fired when the active accordion pane is changed (default event).

JavaScript API

ICEfaces 3.x

The client side component object is exposed through the global variable name specified in the widgetVar attribute.

ICEfaces 4+

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.

Keyboard and ARIA Support

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.

CSS Classes

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>

Known Issues

None.

Additional Resources

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2021 ICEsoft Technologies Canada Corp.