Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.0.0)

E17491-02

<af:resetListener>

resetListener reset listener


The resetListener declarative way to reset input component's submitted values. It is a generalized version of the resetActionListener and should be used in its place. Use the type attribute to select the event the listener should be activated on. All values submitted will be reset to null or empty, and all editable components will be updated with the current values of the model on the server. The reset will not alter any model state directly.

Note: The listOfValues components, like inputComboboxListOfValues, push their value to the model on selection irrespective of the autoSubmit property on the component. Because the reset updates the component with the current value of the model on the server, after the reset you will still see the value that the user selected in the listOfValues components, not the value that was there before.

JSF validation is the third lifecycle phase and proceeds the apply request values phase. During the apply request values phase, input components set their submitted value as a property of the input component. The submitted value is kept by the component until after it has been validated. If validation fails, the JSF lifecycle is short-circuited to the render response phase. The submitted value is returned to the client along with associated faces messages.

This listener should be used primarily in situations that use partial page submits. There are times that the submitted values needs to be cleared. Another common use is with an af:popup. This listener be configured to reset the content of a popup by using the "popupFetch", "popupCanceled" or "dialog" event types. The listener will find the event's process root and traverse down through that subtree resetting input components. An event's process root defines an area of the page that an event should act on. Some of the more common components that are defined as process roots includes: form, subform, region, and popup.

<source> <af:commandButton text="commandLink with resetActionListener" id="cl1" immediate="true" actionListener="#{demoInput.reset}"> <af:resetListener type="action" /> </af:commandButton> <af:popup id="popup" contentDelivery="lazyUncached" > <af:resetListener type="popupFetch" /> <af:dialog> <inputText label="reset field"/> </af:dialog> </af:popup> <af:popup id="popup" contentDelivery="immediate" > <af:resetListener type="popupCanceled" /> <af:dialog> <inputText label="reset field"/> </af:dialog> </af:popup> <af:popup id="popup" contentDelivery="lazy" > <af:dialog> <inputText label="reset field"/> <f:facet facetname="buttonBar"> <af:commandButton text="Cancel" id="cl1" immediate="true" actionListener="#{demoInput.cancelPopup}"> <af:resetListener type="action" /> </af:commandButton> <f:facet> </af:dialog> </af:popup></source>

Attributes

Name Type Supports EL? Description
type String No Defines the event type that submitted values should be reset on. This listener must be registered on a component that supports the event type. Acceptable values include:
  • "action": ActionEvent - Components that provide a "actionListener" event method expression property.
  • "calendar": CalendarEvent - Components that provide a "calendarListener" event method expression property.
  • "calendarActivity": CalendarActivityEvent - Components that provide a "calendarActivityListener" event method expression property.
  • "calendarActivityDurationChange": CalendarActivityDurationChangeEvent - Components that provide a "calendarActivityDurationChangeListener" event method expression property.
  • "calendarDisplayChange": CalendarDisplayChangeEvent - Components that provide a "calendarDisplayChangeListener" event method expression property.
  • "carouselSpin": CarouselSpinEvent - Components that provide a "carouselSpinListener" event method expression property.
  • "contextInfo": ContextInfoEvent - Components that provide a "contextInfoListener" event method expression property.
  • "dialog": DialogEvent - Components that provide a "dialogListener" event method expression property.
  • "disclosure": DisclosureEvent - Components that provide a "disclosureListener" event method expression property.
  • "focus": FocusEvent - Components that provide a "focusListener" event method expression property.
  • "launch": LaunchEvent - Components that provide a "launchListener" event method expression property.
  • "launchPopup": LaunchPopupEvent - Components that provide a "launchPopupListener" event method expression property.
  • "poll": PollEvent - Components that provide a "pollListener" event method expression property.
  • "popupCanceled": PopupCanceledEvent - Components that provide a "popupCanceledListener" event method expression property.
  • "popupFetch": PopupFetchEvent - Components that provide a "popupFetchListener" event method expression property.
  • "query": QueryEvent - Components that provide a "queryListener" event method expression property.
  • "queryOperation": QueryOperationEvent - Components that provide a "queryOperationListener" event method expression property.
  • "rangeChange": RangeChangeEvent - Components that provide a "rangeChangeListener" event method expression property.
  • "regionNavigation": RegionNavigationEvent - Components that provide a "regionNavigationListener" event method expression property.
  • "return": ReturnEvent - Components that provide a "returnListener" event method expression property.
  • "returnPopup": ReturnPopupEvent - Components that provide a "returnPopupListener" event method expression property.
  • "returnPopupData": ReturnPopupDataEvent - Components that provide a "returnPopupDataListener" event method expression property.
  • "rowDisclosure": RowDisclosureEvent - Components that provide a "rowDisclosureListener" event method expression property.
  • "selection": SelectionEvent - Components that provide a "selectionListener" event method expression property.
  • "sort": SortEvent - Components that provide a "sortListener" event method expression property.
  • "valueChange": ValueChangeEvent - Components that provide a "valueChangeListener" event method expression property.