ResetInput

Input components keep their local values at state when validation fails. ResetInput is used to clear the cached values from state so that components retrieve their values from the backing bean model instead.

Documentation
Form
<h:form id="form">
    <p:panel id="panel" header="Form" style="margin-bottom:10px;">
        <p:messages id="messages" />
        <h:panelGrid columns="3" cellpadding="5">
            <p:outputLabel for="text1" value="Text 1:" />
            <p:inputText id="text1" value="#{resetInputView.text1}" required="true" label="Firstname">
                <f:validateLength minimum="2" />
            </p:inputText>
            <p:message for="text1" />

            <p:outputLabel for="text2" value="Text 2:" />
            <p:inputText id="text2" value="#{resetInputView.text2}" required="true" label="Surname"/>
            <p:message for="text2" />
        </h:panelGrid>
    </p:panel>

    <p:toolbar>
        <f:facet name="left">
            <p:commandButton value="Submit" update="panel" action="#{resetInputView.save}" style="margin-right:20px;" />
        </f:facet>
        
        <f:facet name="right">
            <p:commandButton value="Reset Fail" update="panel" process="@this" action="#{resetInputView.resetFail}" style="margin-right:20px;" />

            <p:commandButton value="Reset Tag" update="panel" process="@this" style="margin-right:20px;" >
                <p:resetInput target="panel" />
            </p:commandButton>

            <p:commandButton value="Reset Code" update="panel" process="@this" action="#{resetInputView.reset}"  style="margin-right:20px;" />

            <p:commandButton value="Reset Non-Ajax" action="#{resetInputView.reset}" immediate="true" ajax="false" style="margin-right:20px;">
                <p:resetInput target="panel" />
            </p:commandButton>

            <h:commandButton value="Reset p:ajax" style="margin-right:20px;" >
                <p:ajax update="panel" resetValues="true" />
            </h:commandButton>
        </f:facet>
    </p:toolbar>
</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.