DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 81ab5d37
    Year: 1970
    Color: Orange
  • Id: 91996469
    Year: 1964
    Color: Yellow
  • Id: 48d4864f
    Year: 1979
    Color: White
  • Id: 9b0518d4
    Year: 1968
    Color: Black
  • Id: 2cbb43f8
    Year: 2008
    Color: Orange
  • Id: 7bd4d932
    Year: 2009
    Color: Blue
  • Id: 44124c22
    Year: 1981
    Color: Brown
  • Id: bed5e0a9
    Year: 1964
    Color: Orange
  • Id: 28bcbe7d
    Year: 1979
    Color: Orange
  • Id: 7dd2bce0
    Year: 1981
    Color: Blue
  • Id: 2c2e313a
    Year: 1967
    Color: Black
  • Id: 871efdc4
    Year: 1987
    Color: Green
  • Id: a4bc051e
    Year: 2000
    Color: White
  • Id: a12de2b2
    Year: 2009
    Color: Black
  • Id: 09ac5b06
    Year: 1995
    Color: Yellow
  • Id: dc3036c0
    Year: 1982
    Color: Red
  • Id: 408fbc36
    Year: 2001
    Color: Blue
  • Id: 2c5589ec
    Year: 1965
    Color: Orange
  • Id: 28dd3f0f
    Year: 1968
    Color: Yellow
  • Id: 0fdf4f1e
    Year: 2007
    Color: Brown
  • Id: a3429c44
    Year: 1992
    Color: Black
  • Id: b40d0eb4
    Year: 1992
    Color: Orange
  • Id: 8688f92c
    Year: 2002
    Color: Maroon
  • Id: aef3b116
    Year: 1961
    Color: Black
  • Id: b258f17b
    Year: 1963
    Color: Maroon
  • Id: 003df478
    Year: 1989
    Color: Black
  • Id: 0452f56a
    Year: 1996
    Color: Brown
  • Id: 22941640
    Year: 2001
    Color: Yellow
  • Id: 85ff77f3
    Year: 2004
    Color: Silver
  • Id: 2e2128be
    Year: 1993
    Color: Green
  • Id: 3a371f10
    Year: 2005
    Color: Silver
  • Id: 71483dcd
    Year: 2001
    Color: Orange
  • Id: 6994905c
    Year: 1964
    Color: Orange
  • Id: f7a67081
    Year: 2008
    Color: Maroon
  • Id: ca079752
    Year: 1973
    Color: Silver
  • Id: a2fff06c
    Year: 1965
    Color: Blue
  • Id: 886c5a07
    Year: 1974
    Color: Black
  • Id: 569d9cd9
    Year: 2008
    Color: Orange
  • Id: ee355ad8
    Year: 1970
    Color: Green
  • Id: 4055ac25
    Year: 1968
    Color: Brown
  • Id: e4214b46
    Year: 1967
    Color: Orange
  • Id: d3ffd508
    Year: 1993
    Color: Maroon
  • Id: 1a13805f
    Year: 1994
    Color: Orange
  • Id: 8d247bea
    Year: 2007
    Color: Blue
  • Id: 4efa6291
    Year: 1972
    Color: Orange
  • Id: c6019490
    Year: 1964
    Color: Yellow
  • Id: 151bbf0b
    Year: 1984
    Color: Blue
  • Id: a9913338
    Year: 1962
    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.