Homepage | Developers
ResetInput
This example demonstrates an overview table with all persions and a detail view for person details. Click on a person name in the table to go to the corresponding detail view. This detail view has three input fields: Name (required), Tax Class (only number allowed), Birth Date (only date allowed). Type a wrong data, e.g. Tax Class as string instead of number, and push "Save" button. You will see a validation error. Both "cancel" buttons force a back navigation to the overview table. Try to click on the first "Regular Cancel" button and select another person in the table. You will see partially last shown data from the last selected person and not data from the current selected person. If Tax Class would not pass validation, Name and Birth Date from the last selected person would be shown. The second button with attached pe:resetInput solves this problem.
NameTax ClassBirth Date
Max Mustermann125.06.1972
Sara Schmidt210.01.1982
Jasper Morgan313.03.1968
Source
<h:panelGroup id="personsGroup">
    <p:messages/>

    <p:dataTable id="persons" value="#{advancedResetInputController.persons}" var="person"
                 rendered="#{empty advancedResetInputController.selectedPerson}">
        <p:column headerText="Name">
            <p:commandLink value="#{person.name}"
                           action="#{advancedResetInputController.showPersonDetails(person)}"
                           process=":mainForm:personsGroup" update=":mainForm:personsGroup"/>
        </p:column>
        <p:column headerText="Tax Class">
            <h:outputText value="#{person.taxClass}"/>
        </p:column>
        <p:column headerText="Birth Date">
            <h:outputText value="#{person.birthDate}">
                <f:convertDateTime pattern="dd.MM.yyyy"/>
            </h:outputText>
        </p:column>
    </p:dataTable>

    <h:panelGroup rendered="#{not empty advancedResetInputController.selectedPerson}">
        <h:panelGrid id="personDetail" columns="2" columnClasses="formColumn1,formColumn2">
            <h:outputText value="Name (string)"/>
            <h:inputText value="#{advancedResetInputController.selectedPerson.name}"
                         required="true" label="Name"/>
            <h:outputText value="Tax Class (number)"/>
            <h:inputText value="#{advancedResetInputController.selectedPerson.taxClass}"
                         required="true" label="Tax Class">
                <f:validateLength maximum="1"/>
            </h:inputText>
            <h:outputText value="Birth Date (date dd.MM.yyyy)"/>
            <h:inputText value="#{advancedResetInputController.selectedPerson.birthDate}"
                         required="true" label="Birth Date">
                <f:convertDateTime pattern="dd.MM.yyyy"/>
            </h:inputText>
        </h:panelGrid>

        <p:commandButton value="Save" action="#{advancedResetInputController.updatePersonDetails}"
                         process="personsGroup" update="personsGroup"
                         style="margin-top: 10px;" icon="ui-icon-disk"/>
        <p:commandButton value="Regular Cancel" action="#{advancedResetInputController.cancelPersonDetails}"
                         update="personsGroup" immediate="true" icon="ui-icon-close"/>
        <p:commandButton value="Cancel with pe:resetInput"
                         action="#{advancedResetInputController.cancelPersonDetails}"
                         update="personsGroup" immediate="true" icon="ui-icon-close">
            <pe:resetInput for="personDetail"/>
        </p:commandButton>
    </h:panelGroup>
</h:panelGroup>
            
Components and more
Use Cases
Documentation pe:resetInput
Attributes (move mouse over the names to see data types)
Name Description
for Id(s) of component(s) in terms of findComponent to specify components to be reseted. That can be space or comma separated list.
event Name(s) of one or several accepted events of f:ajax / p:ajax in case when ResetInput is attached to any component with ajax behavior. Several events should be defined as space or comma separated list. If no events are specified, all events will be accepted.
PrimeFaces Extensions Showcase - © 2011-2013, PrimeFaces: 3.5, PrimeFaces Extensions: 0.7.0, JSF: mojarra 2.1.18, Server: jetty/8.1.0.RC2, Build time: 2013-05-04 16:56
Theme
afterdark
afternoon
afterwork
aristo
black-tie
blitzer
bluesky
bootstrap
casablanca
cruze
cupertino
dark-hive
dot-luv
eggplant
excite-bike
flick
glass-x
home
hot-sneaks
humanity
le-frog
midnight
mint-choc
overcast
pepper-grinder
redmond
rocket
sam
smoothness
south-street
start
sunny
swanky-purse
trontastic
ui-darkness
ui-lightness
vader
Developers
Thomas Andraschko zoigln@googlemail.com
Oleg Varaksin ovaraksin@googlemail.com
Nilesh Namdeo Mali nileshmali86@gmail.com
Mauricio Fenoglio fenoglio.mauricio@gmail.com
Pavol Slaný pavol.slany@gmail.com
Sudheer Jonna sudheer.jonna@gmail.com