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
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
Vietnamese
Chinese
Chinese

Input Style

Themes

PrimeOne
Saga Saga
Vela Vela
Arya Arya
Bootstrap
bootstrap4-blue-light Bootstrap Blue
bootstrap4-purple-light Bootstrap Purple
bootstrap4-blue-dark Bootstrap Blue
bootstrap4-purple-dark Bootstrap Purple
Material Design
material-indigo-light Indigo
material-deeppurple-light' Deep Purple
material-indigo-dark Indigo
material-deeppurple-dark' Deep Purple
Material Design Compact
material-indigo-light Indigo
material-deeppurple-light' Deep Purple
material-indigo-dark Indigo
material-deeppurple-dark' Deep Purple

Client Side Validation Complex

This examples shows how you can implement complex validation on the clide side like conditional validation or "connected" validation over mulitple inputs.
If you select "Name required", you have to set content in the "Name" input.

Validate

<script>
    //<![CDATA[
    PrimeFaces.validator['MyComplexValidator'] = {

        validate: function (element) {
            var nameRequired = element.find('#form\\:nameRequired');
            var name = element.find('#form\\:name');

            if (nameRequired.find('.ui-chkbox-icon').hasClass('ui-icon-check') && name.val().length === 0) {
                PrimeFaces.validator.Highlighter.types['default'].highlight(name);

                throw {
                    summary: 'Validation Error',
                    detail: 'A name is required!'
                };
            } else {
                PrimeFaces.validator.Highlighter.types['default'].unhighlight(name);
            }
        }
    };
    //]]>
</script>

<div class="card">
    <h:form id="form">
        <p:panel header="Validate" pt:data-p-val="MyComplexValidator">
            <p:messages showDetail="true">
                <p:autoUpdate/>
            </p:messages>

            <h:panelGrid id="grid" columns="3" cellpadding="5">
                <p:outputLabel for="@next" value="Name required"/>
                <p:selectBooleanCheckbox id="nameRequired" value="#{complexValidationView.nameRequired}"/>
                <p:message for="@previous"/>

                <p:outputLabel for="@next" value="Name"/>
                <p:inputText id="name" value="#{complexValidationView.name}" label="Name"/>
                <p:message for="@previous"/>

                <p:outputLabel for="@next" value="Accept Terms And Conditions"/>
                <p:selectBooleanCheckbox id="terms" value="#{complexValidationView.acceptTermnsAndCondition}"/>
                <p:message for="@previous"/>
            </h:panelGrid>

            <p:defaultCommand target="btnAjax"/>

            <p:commandButton value="Non-Ajax" ajax="false" icon="pi pi-check" validateClient="true"
                             style="margin-right:10px"/>
            <p:commandButton value="Ajax" id="btnAjax" update="grid" icon="pi pi-check" validateClient="true"
                             style="margin-right:10px"/>
            <p:commandButton value="Disabled" ajax="false" icon="pi pi-check" style="margin-right:10px"/>
        </p:panel>
    </h:form>
</div>