📜  Primefaces手风琴面板

📅  最后修改于: 2021-01-08 04:29:53             🧑  作者: Mango

PrimeFaces手风琴面板

它是一个容器组件,显示垂直堆叠的面板。它用于以手风琴格式显示数据。我们可以随时单击一个项目即可将其从一个项目切换到另一个项目。当用户希望一次从集合中看到单个项目时,此功能很有用。

PrimeFaces提供了组件以在JSF应用程序中创建手风琴。

它还具有下表列出的各种属性。

AccordionPanel属性

Attribute Default value Type Description
id null String It is an unique identifier of the component.
activeIndex false String It is used to set Index of the active tab.
style null String It is used to set inline CSS of the container element.
onTabChange null String It is used to call script when an inactive tab is
clicked.
onTabShow null String It is used to call client side script when a tab gets activated.
onTabClose null String It is used to call client side script to invoke when a tab is closed.
dynamic false Boolean It defines the toggle mode.
cache true Boolean It defines if activating a dynamic tab should load the contents from server again.
value null List It takes list to iterate to display dynamic number of tabs.
var null String It is a name of iterator to use in a dynamic number of tabs
tabController null MethodExpr It is used to set server side listener to decide whether a tab change or tab close should be allowed.

在下面的示例中,我们正在实现组件。本示例包含以下文件。

JSF文件

// Accordian.xhtml





Accordion Panel




Select a Course

输出: