You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Andy Schwartz <an...@gmail.com> on 2009/05/26 23:12:25 UTC

[Trinidad][API] ChangeManager: Ability to apply component changes to a subtree

Gang -

As discussed in the following issue:

http://issues.apache.org/jira/browse/TRINIDAD-1488

I need the ability to apply ChangeManager component changes to a
specific component subtree (within a NamingContainer) as opposed to
the entire view.  The goal is to be able to apply ChangeManager
component changes to component subtrees that are populated
dynamically, after applyComponentChangesForCurrentView() has been
called.  However, currently ChangeManager only provides:

  /**
   * Applies all the ComponentChanges added so far for the current
view.
   * Developers should not need to call this method. Internal
implementation
   * will call it as the component tree is built and is ready to take
changes.
   * @param facesContext The FacesContext instance for the current
request.
   */
  public void applyComponentChangesForCurrentView(FacesContext facesContext)


I would like to introduce a new method to handle the subtree case, eg:


  /**
   * Applies the ComponentChanges added so far for components
underneath
   * the specified NamingContainer component.
   * Developers should not need to call this method. Internal
implementation
   * will call it as the component tree is built and is ready to take
changes.
   * @param facesContext The FacesContext instance for the current
request.
   * @param root A NamingContainer component that contains the
subtree
   * to which ComponentChanges should be applied.  If null, all
changes are
   * applied.
   * @throws IllegalArgumentException if the root component is not a
   *   NamingContainer instance.
   */
  public void applyComponentChangesForSubtree(
    FacesContext facesContext,
    UIComponent  root
    )

Comments/questions?

Andy

Re: [Trinidad][API] ChangeManager: Ability to apply component changes to a subtree

Posted by Matthias Wessendorf <ma...@apache.org>.
On Wed, May 27, 2009 at 1:12 AM, Andy Schwartz
<an...@gmail.com> wrote:
> Quick follow up...
>
> I have been going back and forth between UIComponent and
> NamingContainer for the type for the "root" parameter.  After
> discussing this offline with Blake, I believe that specifying
> NamingContainer is the better way to go.  This makes the contract more
> explicit and allows us to catch misuse at compile time instead of
> runtime.

sounds good.

+1

>
> Andy
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: [Trinidad][API] ChangeManager: Ability to apply component changes to a subtree

Posted by Andy Schwartz <an...@gmail.com>.
Quick follow up...

I have been going back and forth between UIComponent and
NamingContainer for the type for the "root" parameter.  After
discussing this offline with Blake, I believe that specifying
NamingContainer is the better way to go.  This makes the contract more
explicit and allows us to catch misuse at compile time instead of
runtime.

Andy