DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 17e8e030
    Year: 1978
    Color: Silver
  • Id: c3d8b6b2
    Year: 1991
    Color: Brown
  • Id: ba4524ff
    Year: 1971
    Color: White
  • Id: a0c6b884
    Year: 1981
    Color: Brown
  • Id: 0f27c7fe
    Year: 1987
    Color: Yellow
  • Id: c48def64
    Year: 1975
    Color: Black
  • Id: e8b9e23d
    Year: 1965
    Color: Red
  • Id: 2c556488
    Year: 2007
    Color: Silver
  • Id: df950670
    Year: 1960
    Color: Yellow
  • Id: 1a91356f
    Year: 1962
    Color: Red
  • Id: 1d6ee7b4
    Year: 1975
    Color: Black
  • Id: b2e5a1e4
    Year: 1969
    Color: Blue
  • Id: a7556e92
    Year: 1971
    Color: Brown
  • Id: 462905fc
    Year: 1962
    Color: Orange
  • Id: 64d7ea49
    Year: 2003
    Color: Red
  • Id: a2f79400
    Year: 1980
    Color: Black
  • Id: f95591e7
    Year: 1972
    Color: Yellow
  • Id: 97123874
    Year: 1996
    Color: Maroon
  • Id: e4d06862
    Year: 1981
    Color: Red
  • Id: e6d5c8c1
    Year: 2008
    Color: Orange
  • Id: 1fd1e9aa
    Year: 1994
    Color: Yellow
  • Id: 7d653b4d
    Year: 1981
    Color: Green
  • Id: 45db2c05
    Year: 1961
    Color: Silver
  • Id: 6a9f50f1
    Year: 1972
    Color: Black
  • Id: 38e8f13f
    Year: 1999
    Color: Maroon
  • Id: 19846b3f
    Year: 2001
    Color: Black
  • Id: c9588757
    Year: 1981
    Color: Brown
  • Id: e3266c1f
    Year: 1962
    Color: Green
  • Id: 88353dfa
    Year: 2007
    Color: Green
  • Id: 9f8691a8
    Year: 2002
    Color: Red
  • Id: f64957bf
    Year: 1976
    Color: Green
  • Id: d030f231
    Year: 1991
    Color: Yellow
  • Id: f9dcf498
    Year: 1960
    Color: Red
  • Id: 79528549
    Year: 2005
    Color: Maroon
  • Id: 102ae64e
    Year: 1970
    Color: Orange
  • Id: 5b481767
    Year: 2005
    Color: White
  • Id: 4aa3c384
    Year: 2008
    Color: Silver
  • Id: 27d14bd8
    Year: 1983
    Color: Yellow
  • Id: e4cec28c
    Year: 1995
    Color: Yellow
  • Id: 7cad2f4a
    Year: 1969
    Color: Green
  • Id: 2d31f4fc
    Year: 1985
    Color: Maroon
  • Id: 8223e4dc
    Year: 1972
    Color: Blue
  • Id: 40435933
    Year: 1972
    Color: Green
  • Id: 120de19f
    Year: 1984
    Color: Blue
  • Id: b7aaaca8
    Year: 2009
    Color: Green
  • Id: 2976613b
    Year: 1986
    Color: Yellow
  • Id: e8a6376c
    Year: 1968
    Color: Black
  • Id: 8ad476fa
    Year: 1992
    Color: Brown
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.