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: 173d5c63
    Year: 1991
    Color: Orange
  • Id: 1ef2c0d9
    Year: 1981
    Color: Blue
  • Id: 6490d733
    Year: 1996
    Color: Maroon
  • Id: 3bfa1b19
    Year: 1980
    Color: Blue
  • Id: 86a58dda
    Year: 2000
    Color: Maroon
  • Id: 33d3cfa2
    Year: 1966
    Color: Silver
  • Id: c099bd63
    Year: 1995
    Color: Green
  • Id: 77716f25
    Year: 1974
    Color: Black
  • Id: d2f40311
    Year: 1986
    Color: Brown
  • Id: a7a0d736
    Year: 1980
    Color: White
  • Id: 809cf59a
    Year: 1968
    Color: Blue
  • Id: dac24663
    Year: 1975
    Color: Maroon
  • Id: d9284849
    Year: 1972
    Color: Red
  • Id: 67f13bb5
    Year: 1968
    Color: Blue
  • Id: 64554b66
    Year: 1973
    Color: Silver
  • Id: 210bebe6
    Year: 1991
    Color: Red
  • Id: 0b06ab2b
    Year: 1968
    Color: Black
  • Id: dd12a39e
    Year: 1976
    Color: Yellow
  • Id: ddfc0244
    Year: 1978
    Color: Maroon
  • Id: 0b7a0504
    Year: 1976
    Color: Red
  • Id: 51e220aa
    Year: 1995
    Color: Silver
  • Id: 3159a769
    Year: 1960
    Color: Red
  • Id: 9d566d19
    Year: 1990
    Color: Green
  • Id: 61c436e7
    Year: 1979
    Color: Brown
  • Id: 948b2439
    Year: 1991
    Color: Red
  • Id: 6c2e82f6
    Year: 1975
    Color: Black
  • Id: f750aab4
    Year: 1995
    Color: Orange
  • Id: 2adbe81a
    Year: 1985
    Color: Maroon
  • Id: 4e024133
    Year: 1970
    Color: Green
  • Id: 8a28848e
    Year: 1999
    Color: Maroon
  • Id: cd2f790e
    Year: 1996
    Color: Red
  • Id: 5b395228
    Year: 1992
    Color: Yellow
  • Id: 456d03c5
    Year: 1960
    Color: Green
  • Id: 753147c2
    Year: 1990
    Color: Orange
  • Id: 1646fe52
    Year: 1968
    Color: Orange
  • Id: c036e509
    Year: 1987
    Color: Silver
  • Id: c1e2788d
    Year: 1995
    Color: Blue
  • Id: 3ca34e3e
    Year: 2002
    Color: Silver
  • Id: 5e1a4248
    Year: 1995
    Color: Red
  • Id: 7aa6a361
    Year: 1985
    Color: Silver
  • Id: 2ded0d91
    Year: 1983
    Color: Maroon
  • Id: c8fe6952
    Year: 1974
    Color: Orange
  • Id: 9eeebbd6
    Year: 1972
    Color: Red
  • Id: 79fb79c8
    Year: 1978
    Color: Red
  • Id: 802f07e3
    Year: 1997
    Color: White
  • Id: d79089c7
    Year: 1962
    Color: Silver
  • Id: 4024e480
    Year: 2001
    Color: White
  • Id: 70365faf
    Year: 1960
    Color: Orange
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.