myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Schofield <sean.schofi...@gmail.com>
Subject Re: svn commit: r344383 - /myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
Date Fri, 18 Nov 2005 02:22:03 GMT
MYFACES-692 (see SVN note.)  Before the patch you could not use forceId.

sean

On 11/17/05, Travis Reeder <treeder@gmail.com> wrote:
> Hi Sean,
>
> What was this checkin fixing?  Seems strange to override the default
> findComponent() method in here?
>
> Travis
>
> ---------- Forwarded message ----------
> From: schof@apache.org <schof@apache.org>
> Date: Nov 15, 2005 7:56 AM
> Subject: svn commit: r344383 -
> /myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
> To: commits@myfaces.apache.org
>
>
> Author: schof
> Date: Tue Nov 15 07:55:57 2005
> New Revision: 344383
>
> URL: http://svn.apache.org/viewcvs?rev=344383&view=rev
> Log:
> Fixes MYFACES-692 (patch by Chris Barlow.)
>
> Modified:
>     myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
>
> Modified: myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
> URL: http://svn.apache.org/viewcvs/myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java?rev=344383&r1=344382&r2=344383&view=diff
> ==============================================================================
> --- myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
> (original)
> +++ myfaces/sandbox/trunk/src/java/org/apache/myfaces/custom/ajax/api/AjaxPhaseListener.java
> Tue Nov 15 07:55:57 2005
> @@ -80,18 +80,33 @@
>          }
>      }
>
> +    public UIComponent findComponent(FacesContext context,
> UIComponent root, String clientId)
> +    {
> +        UIComponent component = null;
> +        for(int i = 0; i < root.getChildCount() && component == null; i++)
> +        {
> +            UIComponent child = (UIComponent)root.getChildren().get(i);
> +            component = findComponent(context, child, clientId);
> +        }
> +
> +        if(component == null && root.getClientId(context).equals(clientId))
> +        {
> +            component = root;
> +        }
> +        return component;
> +    }
> +
>      public void afterPhase(PhaseEvent event)
>      {
>          log.debug("In AjaxPhaseListener afterPhase");
>          FacesContext context = event.getFacesContext();
>
>          if (context.getExternalContext().getRequestParameterMap().containsKey("affectedAjaxComponent"))
> -        {
> -            UIViewRoot root = context.getViewRoot();
> -
> -            UIComponent ajaxComponent = root.findComponent((String)
> context.getExternalContext().getRequestParameterMap().get("affectedAjaxComponent"));
> -
> +        {
> +            String clientId =
> (String)context.getExternalContext().getRequestParameterMap().get("affectedAjaxComponent");
> +            UIComponent ajaxComponent = findComponent(context,
> context.getViewRoot(), clientId);
>              log.debug("affectedAjaxComponent: " + ajaxComponent + " -
> " + ajaxComponent.getId());
> +
>              if (ajaxComponent instanceof AjaxComponent)
>              {
>

Mime
View raw message