DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: fef09ce8
    Year: 1981
    Color: Red
  • Id: 9fb5db16
    Year: 1960
    Color: Brown
  • Id: 478015f5
    Year: 2004
    Color: Yellow
  • Id: a39edfea
    Year: 1999
    Color: Maroon
  • Id: f3917296
    Year: 1996
    Color: Blue
  • Id: 27f2d805
    Year: 1972
    Color: Red
  • Id: f1e6e940
    Year: 1969
    Color: Black
  • Id: 15656e8d
    Year: 2004
    Color: Maroon
  • Id: 41c9448d
    Year: 1995
    Color: White
  • Id: 6de0b52c
    Year: 1977
    Color: Brown
  • Id: ef999919
    Year: 1990
    Color: Red
  • Id: 28f1accc
    Year: 1982
    Color: Brown
  • Id: df7f1e52
    Year: 1979
    Color: Blue
  • Id: 395cac04
    Year: 1964
    Color: Green
  • Id: 21975a3b
    Year: 2004
    Color: Orange
  • Id: d5402474
    Year: 1982
    Color: Yellow
  • Id: 532c506c
    Year: 1966
    Color: Yellow
  • Id: 88264332
    Year: 1989
    Color: Black
  • Id: 72b37482
    Year: 1963
    Color: Red
  • Id: 03b1f62c
    Year: 1963
    Color: White
  • Id: 2a1655e5
    Year: 1998
    Color: Green
  • Id: c23dbf85
    Year: 1987
    Color: Black
  • Id: 1d5c67d6
    Year: 1983
    Color: Yellow
  • Id: 3b790786
    Year: 1976
    Color: Blue
  • Id: 820e5b13
    Year: 2000
    Color: Green
  • Id: cce48046
    Year: 1971
    Color: Red
  • Id: c65b9569
    Year: 2000
    Color: Maroon
  • Id: 19941ae1
    Year: 1963
    Color: Yellow
  • Id: 1b3519d8
    Year: 1969
    Color: Yellow
  • Id: 6ace15c1
    Year: 1980
    Color: Yellow
  • Id: 3bdc5bb4
    Year: 1977
    Color: Green
  • Id: 23d3a5eb
    Year: 2000
    Color: Yellow
  • Id: 6462530a
    Year: 1964
    Color: Orange
  • Id: 5760a42d
    Year: 1999
    Color: Yellow
  • Id: daba488c
    Year: 2004
    Color: Brown
  • Id: b10b4a28
    Year: 1978
    Color: White
  • Id: ac9efec8
    Year: 1974
    Color: Blue
  • Id: e80b3f9b
    Year: 2000
    Color: Blue
  • Id: ae69022c
    Year: 1996
    Color: Maroon
  • Id: deef548e
    Year: 1975
    Color: Maroon
  • Id: de211917
    Year: 1995
    Color: Green
  • Id: cfdc9963
    Year: 1986
    Color: Yellow
  • Id: 497f00ef
    Year: 1997
    Color: Black
  • Id: 6444de1a
    Year: 1990
    Color: Yellow
  • Id: c1a95aec
    Year: 1976
    Color: Orange
  • Id: 2f33fda8
    Year: 1984
    Color: Silver
  • Id: 75d49d4f
    Year: 2009
    Color: Maroon
  • Id: 754ae6c8
    Year: 1986
    Color: Silver
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.