DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: d779084e
    Year: 1987
    Color: Yellow
  • Id: 15a186d8
    Year: 1977
    Color: Maroon
  • Id: b7a8910b
    Year: 2004
    Color: Maroon
  • Id: aa54bbf6
    Year: 1988
    Color: Maroon
  • Id: ec77d8bd
    Year: 1998
    Color: Maroon
  • Id: cf3b1507
    Year: 2003
    Color: Black
  • Id: 053af2b6
    Year: 1994
    Color: Brown
  • Id: 790b4026
    Year: 1980
    Color: Orange
  • Id: e30b9b14
    Year: 1998
    Color: Blue
  • Id: fed7cf1f
    Year: 2002
    Color: Red
  • Id: 7855a349
    Year: 2003
    Color: Red
  • Id: 85dcfe38
    Year: 2006
    Color: Maroon
  • Id: ff6bd604
    Year: 1964
    Color: White
  • Id: f12351a7
    Year: 1996
    Color: Yellow
  • Id: dfdb4911
    Year: 1968
    Color: Brown
  • Id: 4f4f2feb
    Year: 1997
    Color: Black
  • Id: d1095717
    Year: 1978
    Color: Brown
  • Id: c882bd61
    Year: 2009
    Color: Brown
  • Id: 4789398f
    Year: 1977
    Color: Blue
  • Id: b38285eb
    Year: 2002
    Color: Green
  • Id: a9911f10
    Year: 2009
    Color: Black
  • Id: a1c52ef8
    Year: 1973
    Color: Maroon
  • Id: b8415e8e
    Year: 2005
    Color: Yellow
  • Id: 7256b365
    Year: 1996
    Color: Silver
  • Id: 79d4c765
    Year: 1965
    Color: White
  • Id: 01ebb807
    Year: 2006
    Color: Red
  • Id: 858c5198
    Year: 1984
    Color: Silver
  • Id: a8d310e3
    Year: 1983
    Color: Black
  • Id: 6200a531
    Year: 1980
    Color: Red
  • Id: 3c06a3f4
    Year: 1988
    Color: Blue
  • Id: c293f3c8
    Year: 2000
    Color: Red
  • Id: d4a53407
    Year: 1970
    Color: Red
  • Id: 2640951b
    Year: 2003
    Color: Blue
  • Id: d821217c
    Year: 1995
    Color: Red
  • Id: ff331f25
    Year: 2006
    Color: Red
  • Id: 03e5c745
    Year: 1964
    Color: Orange
  • Id: c363ef6f
    Year: 1997
    Color: Yellow
  • Id: 71add31b
    Year: 2009
    Color: Silver
  • Id: 3e31fcd9
    Year: 1961
    Color: Brown
  • Id: c8885962
    Year: 1989
    Color: Red
  • Id: a2950d43
    Year: 1999
    Color: Green
  • Id: 871032fc
    Year: 2008
    Color: Maroon
  • Id: c3b0387d
    Year: 1985
    Color: Black
  • Id: d007d0ed
    Year: 1982
    Color: Maroon
  • Id: a041c78b
    Year: 1982
    Color: Silver
  • Id: fce5f037
    Year: 1972
    Color: Green
  • Id: d16edbbe
    Year: 1979
    Color: Green
  • Id: 57d4dcd3
    Year: 1965
    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}"
                gridIcon="pi pi-th-large" listIcon="pi pi-bars">

        <p:dataViewGridItem>
            <p:panel header="#{car.id}" style="text-align:center">
                <h:panelGrid columns="1" style="width:100%">
                    <p:graphicImage name="demo/images/car/#{car.brand}.gif"/> 

                    <h:outputText value="#{car.brand}" />

                    <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:panel>
        </p:dataViewGridItem>

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