Locale

Change the locale of the datepicker, schedule and client side validation messages.

Language
English
English
English
French
German
German
German
Italian
Korean
Spanish
Catalan
Dutch
Portuguese
Portuguese
Arabic
Arabic
Bulgarian
Bangla
Bosnian
Czech
Greek
Persian
Finnish
Danish
Hindi
Indonesian
Croatian
Japanese
Hungarian
Hebrew
Georgian
Central Kurdish
Khmer
Kyrgyz
Kazakh
Lithuanian
Latvian
Malay
Norwegian
Polish
Romanian
Russian
Slovak
Slovenian
Serbian
Serbian
Swedish
Thai
Turkish
Ukrainian
Uzbek
Vietnamese
Chinese
Chinese

Input Style

Themes

PrimeOne
Saga Blue Saga Blue
Vela Blue Vela Blue
Arya Blue Arya Blue
Bootstrap
Bootstrap Blue Light Bootstrap Blue Light
Bootstrap Purple Light Bootstrap Purple Light
Bootstrap Blue Dark Bootstrap Blue Dark
Bootstrap Purple Dark Bootstrap Purple Dark
Material Design
Material Indigo Light Material Indigo Light
Material Deep Purple Light Material Deep Purple Light
Material Indigo Dark Material Indigo Dark
Material Deep Purple Dark Material Deep Purple Dark
Material Design Compact
Material Compact Indigo Light Material Compact Indigo Light
Material Compact Deep Purple Light Material Compact Deep Purple Light
Material Compact Indigo Dark Material Compact Indigo Dark
Material Compact Deep Purple Dark Material Compact Deep Purple Dark
Legacy
Nova Light Nova Light
Nova Dark Nova Dark
Nova Colored Nova Colored
Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink

DataTable Lazy

DataTable has built-in support to deal with huge datasets. In order to enable lazy loading, a LazyDataModel needs to be implemented to query the datasource when pagination, sorting, filtering or live scrolling happens. This example uses an in-memory list to mimic a real datasource like a database. In a real application, loading should be executed with the query built using the information passed to the load method.

NameCountryCompanyRepresentative
Sinclair F Stenseth CanadaChanay, Jeffrey A EsqStephen Shaw
Sinclair H Bowley IndiaChapman, Ross E EsqAnna Fali
Cody Y Malet RussiaChanay, Jeffrey A EsqOnyama Limba
Darci T Chui GermanyChemel, James L CpaAmy Elsner
Wickens F Briddick AustraliaDorl, James J EsqIoni Bowcher
Salvatore Z Perin SpainMorlong AssociatesStephen Shaw
Greenwood T Butt GermanyChanay, Jeffrey A EsqAnna Fali
Silvio W Paprocki ItalyTruhlar And Truhlar AttysOnyama Limba
Maria S Bowley United KingdomMorlong AssociatesXuxue Feng
Cody W Nicka AustraliaChanay, Jeffrey A EsqIoni Bowcher

<div class="card">
    <h:form id="form">
        <p:dataTable var="customer" value="#{dtLazyView.lazyModel}" paginator="true" rows="10"
                     paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                     rowsPerPageTemplate="5,10,15" selectionMode="single"
                     selection="#{dtLazyView.selectedCustomer}"
                     id="customerTable">
            <p:ajax event="rowSelect" listener="#{dtLazyView.onRowSelect}" update=":form:customerDetail"
                    oncomplete="PF('customerDialog').show()"/>
            <p:column headerText="Name" sortBy="#{customer.name}" filterBy="#{customer.name}">
                <h:outputText value="#{customer.name}"/>
            </p:column>
            <p:column headerText="Country" sortBy="#{customer.country}" filterBy="#{customer.country}">
                <span class="flag flag-#{customer.country.code}" style="width: 30px; height: 20px"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem"
                              value="#{customer.country.name}"/>
            </p:column>
            <p:column headerText="Company" sortBy="#{customer.company}" filterBy="#{customer.company}">
                <h:outputText value="#{customer.company}"/>
            </p:column>
            <p:column headerText="Representative" sortBy="#{customer.representative}"
                      filterBy="#{customer.representative}">
                <p:graphicImage name="images/avatar/#{customer.representative.image}" library="demo"
                                width="32" style="vertical-align: middle"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem"
                              value="#{customer.representative.name}"/>
            </p:column>
        </p:dataTable>

        <p:dialog header="Customer Detail" widgetVar="customerDialog" modal="true" showEffect="fade"
                  hideEffect="fade" resizable="false">
            <p:outputPanel id="customerDetail" style="text-align:center;">
                <p:panelGrid columns="2" rendered="#{not empty dtLazyView.selectedCustomer}"
                             columnClasses="label,value">

                    <h:outputText value="Name:"/>
                    <h:outputText value="#{dtLazyView.selectedCustomer.name}"/>

                    <h:outputText value="Country"/>
                    <p:column>
                        <span class="flag flag-#{dtLazyView.selectedCustomer.country.code}"
                              style="width: 30px; height: 20px"/>
                        <h:outputText style="vertical-align: middle; margin-left: .5rem"
                                      value="#{dtLazyView.selectedCustomer.country.name}"/>
                    </p:column>

                    <h:outputText value="Company:"/>
                    <h:outputText value="#{dtLazyView.selectedCustomer.company}"/>

                    <h:outputText value="Representative:"/>
                    <p:column>
                        <p:graphicImage name="images/avatar/#{dtLazyView.selectedCustomer.representative.image}"
                                        library="demo"
                                        width="32" style="vertical-align: middle"/>
                        <h:outputText style="vertical-align: middle; margin-left: .5rem"
                                      value="#{dtLazyView.selectedCustomer.representative.name}"/>
                    </p:column>

                </p:panelGrid>
            </p:outputPanel>
        </p:dialog>
    </h:form>
</div>