DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 218ed31f
    Year: 1991
    Color: Green
  • Id: 31fc7db7
    Year: 1989
    Color: Brown
  • Id: b0c0daa2
    Year: 2003
    Color: Green
  • Id: b952056c
    Year: 1985
    Color: Black
  • Id: 15da3849
    Year: 1996
    Color: Blue
  • Id: f2433b0e
    Year: 1999
    Color: Yellow
  • Id: 26b65d7d
    Year: 1981
    Color: Silver
  • Id: c1b4f44e
    Year: 1999
    Color: Yellow
  • Id: e392919b
    Year: 1975
    Color: Brown
  • Id: 6d0c99c9
    Year: 1992
    Color: Maroon
  • Id: 843b3099
    Year: 2004
    Color: White
  • Id: 517674da
    Year: 1977
    Color: Blue
  • Id: ee3803da
    Year: 2002
    Color: White
  • Id: af8ec9cf
    Year: 1995
    Color: Silver
  • Id: a72228e4
    Year: 1965
    Color: Brown
  • Id: bd963f78
    Year: 1990
    Color: Orange
  • Id: 7757befc
    Year: 1974
    Color: Maroon
  • Id: e586f37e
    Year: 1996
    Color: Yellow
  • Id: dd6eff81
    Year: 1981
    Color: White
  • Id: 86a31624
    Year: 1999
    Color: White
  • Id: 4cad1b83
    Year: 2000
    Color: White
  • Id: e6e74807
    Year: 1992
    Color: Maroon
  • Id: f7c1c8b2
    Year: 1979
    Color: Yellow
  • Id: 4e343082
    Year: 1982
    Color: Maroon
  • Id: 2f07a53c
    Year: 1983
    Color: Black
  • Id: 29b0c515
    Year: 1968
    Color: Green
  • Id: 14ee2446
    Year: 1962
    Color: Green
  • Id: e6a4b3de
    Year: 2001
    Color: Green
  • Id: bef2dc22
    Year: 1996
    Color: Blue
  • Id: b0d67e59
    Year: 1991
    Color: Green
  • Id: f955ab06
    Year: 1977
    Color: Black
  • Id: f270c2e0
    Year: 2007
    Color: Yellow
  • Id: d2bcb470
    Year: 2005
    Color: Silver
  • Id: 5eb630c2
    Year: 1963
    Color: Red
  • Id: b87f1066
    Year: 2003
    Color: Maroon
  • Id: f29e3789
    Year: 1993
    Color: Yellow
  • Id: 730a3227
    Year: 1998
    Color: Silver
  • Id: 94255792
    Year: 2003
    Color: Black
  • Id: 003161c2
    Year: 1993
    Color: Silver
  • Id: 51ea49d2
    Year: 1985
    Color: Yellow
  • Id: 5c4b6be7
    Year: 1987
    Color: White
  • Id: 6e67e6e7
    Year: 1996
    Color: Brown
  • Id: 88e8883e
    Year: 1974
    Color: White
  • Id: 325973db
    Year: 2003
    Color: Yellow
  • Id: a44c0e07
    Year: 1962
    Color: Maroon
  • Id: 5e29c2c3
    Year: 1974
    Color: Maroon
  • Id: 9c7439e8
    Year: 2008
    Color: Blue
  • Id: 8ff52263
    Year: 1996
    Color: Blue
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.