You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2007/07/25 18:59:26 UTC

[Myfaces Wiki] Update of "ClearInputComponents" by AdamWiner

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by AdamWiner:
http://wiki.apache.org/myfaces/ClearInputComponents

------------------------------------------------------------------------------
    component.setValue(null);
    component.setLocalValueSet(false);
  }}}
+ 
- This will cause that component to refetch its value via its value-binding when rendered.
+ This will cause that component to refetch its value via its value-binding when rendered.  In JSF 1.2,
+ a resetValue() convenience function was added for just this set of calls.
  
  This only affects specific components, though. If you want to clear a whole form, you can bind some parent component, then
  explicitly walk the tree of child components testing each one for type !EditableValueHolder, and if so performing the
@@ -77, +79 @@

    uiDataComponent.setRowIndex(-1);
  }}}
  
+ MyFaces Trinidad includes a {{{<tr:resetActionListener>}}} tag that automates this strategy of walking the tree, including tables.
+ 
  === Return a non-null navigation value ===
  
  Commonly, null is returned from the action method of the immediate command component. This causes the current view to be re-rendered.