DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 0d4762f0
    Year: 2006
    Color: Red
  • Id: ae5db4f8
    Year: 1980
    Color: Blue
  • Id: e8c82300
    Year: 1972
    Color: Blue
  • Id: e87667e8
    Year: 1982
    Color: Brown
  • Id: 7e63d630
    Year: 2007
    Color: Orange
  • Id: 6da349b0
    Year: 1964
    Color: Red
  • Id: db4444dc
    Year: 1962
    Color: Maroon
  • Id: 6c4c2f4c
    Year: 1969
    Color: Orange
  • Id: 0c4e8ca4
    Year: 1963
    Color: Maroon
  • Id: 7d5c743f
    Year: 1994
    Color: Yellow
  • Id: 7edc1006
    Year: 1979
    Color: Yellow
  • Id: 227ad152
    Year: 1962
    Color: White
  • Id: 31814e26
    Year: 1995
    Color: Brown
  • Id: 390a00f9
    Year: 1971
    Color: Red
  • Id: 5bac7a45
    Year: 1983
    Color: Maroon
  • Id: 19c8e81e
    Year: 1969
    Color: Green
  • Id: 095e1d13
    Year: 1972
    Color: Maroon
  • Id: 946d295e
    Year: 1961
    Color: White
  • Id: bf17ece9
    Year: 1996
    Color: Blue
  • Id: 5e78c63e
    Year: 1995
    Color: Orange
  • Id: b47b869c
    Year: 1972
    Color: White
  • Id: 96747650
    Year: 1989
    Color: Green
  • Id: 1a533541
    Year: 1968
    Color: Maroon
  • Id: fafc3885
    Year: 1976
    Color: Silver
  • Id: dc5ef8be
    Year: 1984
    Color: Brown
  • Id: 551d53db
    Year: 1964
    Color: Blue
  • Id: 88c40946
    Year: 1973
    Color: Red
  • Id: b8e1607b
    Year: 1990
    Color: Orange
  • Id: e61c1873
    Year: 1966
    Color: White
  • Id: 189a36cd
    Year: 1964
    Color: Orange
  • Id: 6cfaa078
    Year: 2006
    Color: Brown
  • Id: 51ca57d6
    Year: 1976
    Color: White
  • Id: 5379a993
    Year: 1962
    Color: Silver
  • Id: 7ab0c6b5
    Year: 1969
    Color: Green
  • Id: eab529b4
    Year: 1969
    Color: Brown
  • Id: fb2f1d31
    Year: 2009
    Color: Blue
  • Id: 2c5e9a50
    Year: 1976
    Color: Silver
  • Id: 868d15ec
    Year: 2000
    Color: White
  • Id: 22bfa3c9
    Year: 1979
    Color: Orange
  • Id: 8fd28356
    Year: 1981
    Color: Black
  • Id: 1e058d57
    Year: 1980
    Color: Yellow
  • Id: f1e9e77b
    Year: 2003
    Color: Yellow
  • Id: a781080d
    Year: 1965
    Color: White
  • Id: c85c1b76
    Year: 1975
    Color: Red
  • Id: 96212323
    Year: 1996
    Color: Yellow
  • Id: b6795485
    Year: 1998
    Color: Green
  • Id: 367b828e
    Year: 1974
    Color: Black
  • Id: 9402a1cf
    Year: 1965
    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.