How to Use the ICEfaces Panel Series ComponentThe panelSeries component provides a mechanism for dynamically generating a series of repeating child-components within a panel. The panelSeries component renders its child components in an iterative fashion similar to way the dataTable component renders data rows. However, the panelSeries component is more flexibile in that it can render a series of arbitrarily complex child components. The panelSeries component can be used where a JSP forEach tag might have been used. The panelSeries component can be bound to an array, an instance of java.util.List, an instance of java.sql.ResultSet, an instance of java.servlet.jsp.jstl.sql.Result, or an instance of javax.faces.model.DataModel. In the tag, specify the value attribute of the component and the var attribute to represent the name of the current item as the component iterates through each item in the value binding. The rest of this tutorial will discuss the following topics: Creating a Basic Series Panel
<ice:panelSeries var="color" value="#{basicPanelSeriesBean.colorList}"> <ice:outputText value="#{color}" /> </ice:panelSeries> The following screenshot shows what the page looks like once the beans are properly setup.
Creating a Series Panel with Customized Objects
Inside a panelSeries component, you can put any valid JSF/ICEfaces/HTML tags and the markup will be repeated for each item in the collection that is bound to the value attribute of the panelSeries component. In our advanced example, the code inside the panelSeries component will look similar to the following: <ice:panelSeries var="customObject" value="#{customPanelSeriesBean.customObjectList}"> <ice:panelGrid columns="2"> <ice:outputText value="Name:" /> <ice:outputText value="#{customObject.name}" /> <ice:outputText value="Age:" /> <ice:outputText value="#{customObject.age}" /> <ice:outputText value="Email Address:" /> <ice:outputText value="#{customObject.emailAddress}" /> <ice:outputText value="Phone Number:" /> <ice:outputText value="#{customObject.phoneNumber}" /> <ice:outputText value="Anonymous Message?" /> <ice:selectBooleanCheckbox value="#{customObject.anonymous}"/> ...... </ice:panelGrid> <br/> </ice:panelSeries> The following screenshot shows what the page looks like once the beans are properly setup.
Tutorial Source Code Downloads
|
Panel Series
© Copyright 2021 ICEsoft Technologies Canada Corp.