DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 912bef6a
    Year: 1968
    Color: Brown
  • Id: 6f2149ce
    Year: 1979
    Color: Green
  • Id: 3e2c6434
    Year: 1970
    Color: Orange
  • Id: 767eb2bf
    Year: 1983
    Color: Silver
  • Id: addd3f4d
    Year: 2008
    Color: Maroon
  • Id: 81ef9443
    Year: 2009
    Color: White
  • Id: 68f2bb3d
    Year: 1973
    Color: Yellow
  • Id: 2b014232
    Year: 1998
    Color: Black
  • Id: c826e2d5
    Year: 2002
    Color: Brown
  • Id: 789a6623
    Year: 1987
    Color: Blue
  • Id: 1da737f0
    Year: 1973
    Color: Brown
  • Id: c8a0722c
    Year: 1997
    Color: Blue
  • Id: 5b4c074a
    Year: 2008
    Color: Maroon
  • Id: bfc26e7c
    Year: 1979
    Color: Red
  • Id: 56988984
    Year: 1997
    Color: Yellow
  • Id: 387a50c1
    Year: 1994
    Color: Black
  • Id: 780dc6f0
    Year: 1990
    Color: Maroon
  • Id: f8b99e66
    Year: 2005
    Color: Silver
  • Id: 38cbd845
    Year: 1969
    Color: Green
  • Id: 78a6117b
    Year: 1993
    Color: Green
  • Id: aa242902
    Year: 1980
    Color: Green
  • Id: 41ce61c3
    Year: 1979
    Color: Red
  • Id: bef737d5
    Year: 1975
    Color: Black
  • Id: 61fd652d
    Year: 2000
    Color: Blue
  • Id: 7ea5d1b5
    Year: 1990
    Color: Blue
  • Id: a78f95d4
    Year: 1964
    Color: Yellow
  • Id: 1655a3b9
    Year: 1963
    Color: Maroon
  • Id: 5b9c6100
    Year: 1971
    Color: Green
  • Id: 8590899d
    Year: 2008
    Color: Brown
  • Id: 1637c4f4
    Year: 2005
    Color: Silver
  • Id: 8d303e4d
    Year: 1968
    Color: Yellow
  • Id: c055a936
    Year: 1966
    Color: Maroon
  • Id: e00124f7
    Year: 1983
    Color: Blue
  • Id: cd1cde67
    Year: 2001
    Color: Maroon
  • Id: a52dfefd
    Year: 1987
    Color: Green
  • Id: 56df75c6
    Year: 2000
    Color: Green
  • Id: 01595161
    Year: 1971
    Color: Brown
  • Id: 2973cd38
    Year: 2001
    Color: White
  • Id: f5e5db5d
    Year: 1972
    Color: Red
  • Id: ad0e9f48
    Year: 1980
    Color: Yellow
  • Id: bec8809a
    Year: 1996
    Color: Yellow
  • Id: 56a31459
    Year: 1992
    Color: White
  • Id: eb8ea704
    Year: 1977
    Color: Brown
  • Id: 2c828e75
    Year: 2005
    Color: Blue
  • Id: 7d4c632e
    Year: 1973
    Color: Orange
  • Id: 8eba0d28
    Year: 1976
    Color: Maroon
  • Id: a83e1ab0
    Year: 2005
    Color: Maroon
  • Id: 42d7c664
    Year: 1998
    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.