myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "ClearInputComponents" by SimonKitching
Date Fri, 26 Jan 2007 01:35:08 GMT
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 SimonKitching:
http://wiki.apache.org/myfaces/ClearInputComponents

------------------------------------------------------------------------------
  Note: If you want to navigate to another page then omit the optional {{{context.renderResponse();}}}
and save the view with {{{application.getStateManager().saveSerializedView(context);}}}. 
This will avoid session to reference to the old view when you go back to the page (tested
only in JSF RI 1.1.01).
  
  In addition to immediate components, this method can be useful when working with multiple
forms or subForms. [[BR]] Omit the last line "context.renderResponse()", when you don't want
to skip the other life-cycle phases.
+ 
+ === Delete Components Holding Unwanted State ===
+ 
+ Find the parent component of the problem inputs, and call 
+ {{{
+   parentComponent.getChildren().clear();
+ }}}
+ During the render phase, new instances of these child components will then be created, while
other components will not be affected.
+ 
+ This is effectively the same as the above solution, but discards a selected subset of components
rather than the UI!ViewRoot.
+ 
+ Obtaining the parent component to discard can be done via binding. Alternatively, the "action
listener" form of callback can be used for the command; this is passed an !ActionEvent from
which the command component that was clicked can be found. A call to "findComponent" can be
made on this to locate the desired parent component by id, or other similar solutions.
  
  === Explicitly clear submitted value ===
  

Mime
View raw message