DataView - List only

DataView displays data in grid or list layout. But you can use it to only display a list or grid.

Documentation
ui-button
  • Id: 7aca40cb
    Year: 1969
    Color: White
  • Id: f0a5ddbc
    Year: 1976
    Color: Yellow
  • Id: 749baea1
    Year: 1967
    Color: Yellow
  • Id: 1efe6f84
    Year: 1962
    Color: Blue
  • Id: ce9ee54a
    Year: 1994
    Color: Maroon
  • Id: 5f002211
    Year: 2009
    Color: White
  • Id: ae88f6e8
    Year: 1971
    Color: Yellow
  • Id: a03d33fc
    Year: 1988
    Color: Silver
  • Id: 386ab333
    Year: 2009
    Color: Black
  • Id: d5f8df71
    Year: 2008
    Color: Black
  • Id: f670ff6d
    Year: 2007
    Color: Green
  • Id: ce5f1afe
    Year: 2008
    Color: Silver
  • Id: 75085de8
    Year: 1961
    Color: Maroon
  • Id: d16df1f9
    Year: 1974
    Color: Brown
  • Id: 246e7c28
    Year: 2003
    Color: Maroon
  • Id: aab75eba
    Year: 2007
    Color: Maroon
  • Id: 6493db5f
    Year: 2001
    Color: Black
  • Id: 19a001a0
    Year: 1965
    Color: Red
  • Id: 95d85512
    Year: 1972
    Color: Red
  • Id: eab6969b
    Year: 2009
    Color: Maroon
  • Id: 639928ad
    Year: 1961
    Color: Black
  • Id: 34f1dc7b
    Year: 1994
    Color: Brown
  • Id: bd05d07f
    Year: 1983
    Color: Yellow
  • Id: acd549ee
    Year: 1993
    Color: Red
  • Id: 08fb8196
    Year: 2003
    Color: Maroon
  • Id: 12d6fe00
    Year: 2004
    Color: Blue
  • Id: fa06548e
    Year: 1986
    Color: Yellow
  • Id: 7822df07
    Year: 1991
    Color: Yellow
  • Id: 73175cdb
    Year: 1976
    Color: Red
  • Id: 3fd00d52
    Year: 1975
    Color: Orange
  • Id: 94eb8f49
    Year: 2009
    Color: Brown
  • Id: 051a34ac
    Year: 1972
    Color: Green
  • Id: 8b96bbe7
    Year: 1981
    Color: Brown
  • Id: 72bc628a
    Year: 1972
    Color: Brown
  • Id: 0c75cc30
    Year: 1992
    Color: Yellow
  • Id: 488c1b9e
    Year: 1977
    Color: Silver
  • Id: e140d6a9
    Year: 1981
    Color: Yellow
  • Id: a94ae560
    Year: 1966
    Color: Brown
  • Id: 2b007ab3
    Year: 1997
    Color: White
  • Id: 27b2ecc0
    Year: 2009
    Color: Maroon
  • Id: 327f5299
    Year: 1965
    Color: Maroon
  • Id: d99af900
    Year: 1971
    Color: Green
  • Id: 0ddc23a1
    Year: 1972
    Color: Green
  • Id: 20a4c391
    Year: 1996
    Color: Yellow
  • Id: 24503f12
    Year: 2007
    Color: Green
  • Id: 69a60f91
    Year: 1960
    Color: Maroon
  • Id: cf765b85
    Year: 1999
    Color: Blue
  • Id: b9058583
    Year: 1973
    Color: Maroon
Car Info
<style type="text/css"> 
    /*demo*/
    .ui-dataview-list .ui-dataview-row {
        border-bottom: 1px solid #A8A8A8;
        padding: 25px 10px;
        /* with the exported variables from Nova and Luna Themes*/
        border-bottom-color: var(--input-border-color, #A8A8A8);
    }

    .logo {
        width: 5%;
    }
    .detail {
        width: 85%;
        padding-left: 25px;
    }
</style>

<h:form id="form">
    <p:dataView var="car" value="#{dataGridView.cars}" listIcon="pi pi-bars">

        <p:dataViewListItem>
            <h:panelGrid columns="3" style="width:100%" columnClasses="logo,detail">
                <p:graphicImage name="demo/images/car/#{car.brand}-big.gif" /> 

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

                <p:commandLink update=":form:carDetail" oncomplete="PF('carDialog').show()" title="View Detail">
                    <h:outputText styleClass="ui-icon pi pi-search" style="margin:0 auto;" />
                    <f:setPropertyActionListener value="#{car}" target="#{dataGridView.selectedCar}" />
                </p:commandLink>
            </h:panelGrid>
        </p:dataViewListItem>
    </p:dataView>

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

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

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

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

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

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.