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: 909ab74d
    Year: 1971
    Color: Orange
  • Id: 0753f1c4
    Year: 2003
    Color: Maroon
  • Id: 6ff7739a
    Year: 1988
    Color: Green
  • Id: 52fd1515
    Year: 1962
    Color: White
  • Id: ee7a08f0
    Year: 1980
    Color: White
  • Id: a0f7ec37
    Year: 1978
    Color: Orange
  • Id: a8acc623
    Year: 1999
    Color: Black
  • Id: 62edd7ae
    Year: 2007
    Color: Black
  • Id: 003fcda5
    Year: 1987
    Color: Brown
  • Id: e8ec3e05
    Year: 1975
    Color: Blue
  • Id: d5883be6
    Year: 1988
    Color: Yellow
  • Id: c5219c46
    Year: 1994
    Color: Maroon
  • Id: 5814052b
    Year: 1968
    Color: Yellow
  • Id: 9bc020e0
    Year: 1980
    Color: Green
  • Id: 9f76ace6
    Year: 1983
    Color: Black
  • Id: 3716d1e5
    Year: 1974
    Color: Blue
  • Id: 9ce5afda
    Year: 1964
    Color: Silver
  • Id: 1ce34d90
    Year: 1965
    Color: Red
  • Id: 2a135b4c
    Year: 1995
    Color: Orange
  • Id: a6d28e92
    Year: 1985
    Color: Blue
  • Id: 1ad2fda1
    Year: 1976
    Color: Red
  • Id: ea3e1749
    Year: 1993
    Color: Blue
  • Id: 5058c365
    Year: 1997
    Color: Black
  • Id: da86709a
    Year: 1968
    Color: Red
  • Id: 2bf27f90
    Year: 1988
    Color: White
  • Id: c6c2d11b
    Year: 1990
    Color: Brown
  • Id: cf2749e0
    Year: 1975
    Color: Yellow
  • Id: 31e0c722
    Year: 1986
    Color: Silver
  • Id: 8ffae2d4
    Year: 2008
    Color: White
  • Id: fd246ef5
    Year: 1971
    Color: Red
  • Id: b54077ae
    Year: 1976
    Color: Blue
  • Id: 8fb3203e
    Year: 2001
    Color: Brown
  • Id: 90bd031c
    Year: 1964
    Color: White
  • Id: ace041fa
    Year: 2000
    Color: Maroon
  • Id: e3a549d8
    Year: 1964
    Color: Black
  • Id: ab48e0ca
    Year: 1969
    Color: Red
  • Id: 18150b0f
    Year: 2001
    Color: Yellow
  • Id: 15164f58
    Year: 1974
    Color: Silver
  • Id: 77ec7636
    Year: 1986
    Color: Red
  • Id: b860af9c
    Year: 1981
    Color: Blue
  • Id: 39d3120f
    Year: 1975
    Color: Maroon
  • Id: 84e54209
    Year: 1989
    Color: Orange
  • Id: 04a9fecf
    Year: 1995
    Color: Orange
  • Id: 9437ac52
    Year: 1993
    Color: Silver
  • Id: bb54386c
    Year: 1978
    Color: Blue
  • Id: 383a63fb
    Year: 1994
    Color: Red
  • Id: e7e4f908
    Year: 2003
    Color: Green
  • Id: 1c142545
    Year: 1966
    Color: Black
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.