DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: 793d4ec9
    Year: 1990
    Color: Red
  • Id: a3fcdea3
    Year: 1993
    Color: Red
  • Id: d665d564
    Year: 1967
    Color: Green
  • Id: 19999f70
    Year: 1976
    Color: Brown
  • Id: cbb666df
    Year: 1995
    Color: Maroon
  • Id: a150d640
    Year: 1975
    Color: Yellow
  • Id: ef1b891f
    Year: 1967
    Color: Red
  • Id: 8cdb6b1e
    Year: 2000
    Color: Silver
  • Id: b37d2ddf
    Year: 1973
    Color: White
  • Id: beed4a67
    Year: 1974
    Color: Yellow
  • Id: 884f701d
    Year: 2006
    Color: Green
  • Id: 7c841512
    Year: 2008
    Color: White
  • Id: ae506eee
    Year: 1990
    Color: Yellow
  • Id: 0f9a2933
    Year: 1969
    Color: Black
  • Id: ff68ae32
    Year: 1969
    Color: Orange
  • Id: e5e7521b
    Year: 1993
    Color: Maroon
  • Id: 110b3bbb
    Year: 1968
    Color: Green
  • Id: 46547e65
    Year: 2004
    Color: Orange
  • Id: fdc5ac21
    Year: 1973
    Color: White
  • Id: 5f8aa255
    Year: 2007
    Color: White
  • Id: fa538663
    Year: 1969
    Color: Maroon
  • Id: fd1cd375
    Year: 1995
    Color: Yellow
  • Id: 47318b56
    Year: 2001
    Color: Silver
  • Id: 44f45420
    Year: 1993
    Color: Yellow
  • Id: e3d616f8
    Year: 1982
    Color: Yellow
  • Id: b09daeaa
    Year: 2009
    Color: White
  • Id: 6e77df28
    Year: 2001
    Color: Silver
  • Id: cab9a40d
    Year: 1960
    Color: Maroon
  • Id: d5b9e5ce
    Year: 1975
    Color: White
  • Id: 75dbc335
    Year: 1988
    Color: Green
  • Id: cbdf17f5
    Year: 1995
    Color: Orange
  • Id: 33f46d17
    Year: 1995
    Color: Silver
  • Id: 9c976174
    Year: 1992
    Color: White
  • Id: 1ec6650a
    Year: 1974
    Color: Maroon
  • Id: ac2857f2
    Year: 2004
    Color: Silver
  • Id: 7f6ad619
    Year: 1997
    Color: Red
  • Id: 8b2e26d8
    Year: 1970
    Color: Maroon
  • Id: 15e483ed
    Year: 2001
    Color: Brown
  • Id: 11f924d1
    Year: 1976
    Color: Orange
  • Id: 6efedded
    Year: 2008
    Color: Orange
  • Id: 70b2f68f
    Year: 1972
    Color: Red
  • Id: b1145fb4
    Year: 1968
    Color: Yellow
  • Id: 3b01ac64
    Year: 1960
    Color: Blue
  • Id: 8aa01900
    Year: 2009
    Color: White
  • Id: 55b3930a
    Year: 2009
    Color: Black
  • Id: c78dbe25
    Year: 1982
    Color: White
  • Id: 7b23526d
    Year: 1988
    Color: Silver
  • Id: 2f821348
    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.