Repeat

Repeat is an extension to standard repeat component to provide interoperability between JSF implementations and PrimeFaces components.

Id: 20e7b60a
Year: 1970
Color: Blue

Id: 7a5724c3
Year: 1996
Color: White

Id: 12d8cb0b
Year: 1986
Color: Red

Id: 580893f9
Year: 1963
Color: White

Id: 2cddd43a
Year: 2004
Color: White

Id: 42272d14
Year: 1993
Color: Maroon

Id: c34327e5
Year: 1989
Color: Silver

Id: 6b8b3cf3
Year: 2003
Color: White

Id: f2b1325f
Year: 1990
Color: Black

Id: 433aafe0
Year: 1961
Color: Red

Car Info
<style type="text/css">
    .logo {
        width: 5%
    }

    .detail {
        width: 95%;
        padding-left: 25px;
    }

    .detail td {
        font-size: 24px;
    }
</style>


<h:form id="form">
    <p:repeat value="#{dataListView.cars1}" var="car">
        <h:panelGrid columns="2" style="width:100%" columnClasses="logo,detail">
            <p:commandLink update=":form:carDetail" oncomplete="PF('carDialog').show()">
                <f:setPropertyActionListener value="#{car}" target="#{dataListView.selectedCar}" />
                <p:graphicImage name="demo/images/car/#{car.brand}-big.gif" /> 
            </p:commandLink>

            <p:outputPanel>
                <h:panelGrid columns="2" cellpadding="5">
                    <h:outputText value="Id:" />
                    <h:outputText value="#{car.id}" style="font-weight: bold"/>

                    <h:outputText value="Year:" />
                    <h:outputText value="#{car.year}" style="font-weight: bold"/>

                    <h:outputText value="Color:" />
                    <h:outputText value="#{car.color}" style="font-weight: bold"/>
                </h:panelGrid>
            </p:outputPanel>
        </h:panelGrid>
        <hr />
    </p:repeat>

    <p:dialog header="Car Info" widgetVar="carDialog" modal="true" showEffect="blind" hideEffect="explode" resizable="false">
        <p:outputPanel id="carDetail" style="text-align:center;">
            <p:panelGrid  columns="2" rendered="#{not empty dataListView.selectedCar}" columnClasses="label,value">
                <f:facet name="header">
                    <p:graphicImage name="demo/images/car/#{dataListView.selectedCar.brand}-big.gif"/> 
                </f:facet>

                <h:outputText value="Id:" />
                <h:outputText value="#{dataListView.selectedCar.id}" />

                <h:outputText value="Year" />
                <h:outputText value="#{dataListView.selectedCar.year}" />

                <h:outputText value="Color:" />
                <h:outputText value="#{dataListView.selectedCar.color}" style="color:#{dataListView.selectedCar.color}"/>

                <h:outputText value="Price" />
                <h:outputText value="\$#{dataListView.selectedCar.price}" />
            </p:panelGrid>
        </p:outputPanel>
    </p:dialog>
</h:form>