myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r908782 - in /myfaces/trinidad/branches/ar-1715: trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ trinidad-impl/src/main/java/org/apache/m...
Date Thu, 11 Feb 2010 01:14:28 GMT
Author: arobinson74
Date: Thu Feb 11 01:13:40 2010
New Revision: 908782

URL: http://svn.apache.org/viewvc?rev=908782&view=rev
Log:
Potential implementation of TRINIDAD-1715

Modified:
    myfaces/trinidad/branches/ar-1715/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TrainRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandLinkRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PollRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectRangeChoiceBarRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailHeaderRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailItemRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SingleStepButtonBarRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
    myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java

Modified: myfaces/trinidad/branches/ar-1715/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
Thu Feb 11 01:13:40 2010
@@ -27,11 +27,16 @@
 import java.util.Iterator;
 import java.util.List;
 
+import java.util.Map;
+
 import javax.faces.application.ResourceHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIParameter;
 import javax.faces.component.UIViewRoot;
+import javax.faces.component.behavior.ClientBehavior;
 import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.render.Renderer;
 
@@ -212,6 +217,52 @@
   {
   }
 
+  // Note this should probably be made final, but since it is new, doing so could
+  // break compatibility with present sub-classes
+
+  /**
+   * {@inheritDoc}
+   * <p>
+   * Sub-classes should override the
+   * {@link #decode(FacesContext, UIComponent, FacesBean, String)} method
+   * to perform their own decoding logic
+   * </p>
+   *
+   * @see #decode(FacesContext, UIComponent, FacesBean, String)
+   */
+  @Override
+  public final void decode(
+    FacesContext facesContext,
+    UIComponent  component)
+  {
+    FacesBean facesBean = getFacesBean(component);
+    String clientId = null;
+    if (facesBean != null)
+    {
+      clientId = decodeBehaviors(facesContext, component, facesBean);
+    }
+    decode(facesContext, component, facesBean, clientId);
+  }
+
+  /**
+   * Hook for sub-classes to perform their own decode logic
+   * @param facesContext the faces context
+   * @param component the component to decode
+   * @param facesBean the faces bean for the component
+   * @param clientId the client ID if it has been retrieved already
+   * during decoding, otherwise it will be null. Passed in for performance
+   * reasons, so that if it has already been retrieved it will not need to be
+   * retrieved again
+   */
+  protected void decode(
+    @SuppressWarnings("unused") FacesContext facesContext,
+    @SuppressWarnings("unused") UIComponent  component,
+    @SuppressWarnings("unused") FacesBean    facesBean,
+    @SuppressWarnings("unused") String       clientId)
+  {
+    // No-op
+  }
+
   //
   // COERCION HELPERS
   //
@@ -794,9 +845,9 @@
   {
     return (Agent.PLATFORM_GENERICPDA.equals(rc.getAgent().getPlatformName()));
   }
-  
+
   /**
-   * This method returns true if a user-agent's platform is NokiaS60 
+   * This method returns true if a user-agent's platform is NokiaS60
    * @param arc - RenderingContext of a request
    * @return boolean
    */
@@ -856,6 +907,64 @@
   //
 
   /**
+   * Decodes the behaviors of this component, if it is the component that is the source
+   * of the call to the server and the event matches behaviors that are attached to
+   * the component
+   *
+   * @param facesContext the faces context
+   * @param component the component
+   * @param bean the faces bean
+   * @return the client ID if it was retrieved, null otherwise
+   */
+  protected final String decodeBehaviors(
+    FacesContext facesContext,
+    UIComponent  component,
+    FacesBean    bean)
+  {
+    if (!(component instanceof ClientBehaviorHolder))
+    {
+      return null;
+    }
+
+    // Check if there are client behaviors first as it should be faster to access then
+    // getting the behavior event from the request parameter map (fewer method calls)
+    Map<String, List<ClientBehavior>> behaviorsMap = bean.getClientBehaviors();
+    if (behaviorsMap.isEmpty())
+    {
+      return null;
+    }
+
+    // Get the behavior event sent by the client, if any
+    Map<String, String> requestParams = facesContext.getExternalContext().getRequestParameterMap();
+    String event = requestParams.get(_BEHAVIOR_EVENT_KEY);
+    if (event == null)
+    {
+      return null;
+    }
+
+    // Does the component have behaviors for this event type?
+    List<ClientBehavior> behaviors = bean.getClientBehaviors().get(event);
+    if (behaviors.isEmpty())
+    {
+      return null;
+    }
+
+    // See if this is the submitting component
+    String clientId = component.getClientId(facesContext);
+    String sourceClientId = requestParams.get("javax.faces.source");
+    if (clientId.equals(sourceClientId))
+    {
+      // Decode the behaviors
+      for (ClientBehavior behavior: behaviors)
+      {
+        behavior.decode(facesContext, component);
+      }
+    }
+
+    return clientId;
+  }
+
+  /**
    * Get a collection of all the parameters that are children of the current component as
    * client behavior parameters.
    * @param component The component
@@ -990,4 +1099,5 @@
 
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(
     CoreRenderer.class);
+  private static final String _BEHAVIOR_EVENT_KEY = "javax.faces.behavior.event";
 }

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ChartRenderer.java
Thu Feb 11 01:13:40 2010
@@ -86,15 +86,18 @@
    */
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     String source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-    String id = component.getClientId(context);
+    String id = clientId == null ? component.getClientId(facesContext) : clientId;
     if (!id.equals(source))
       return;
     Object eventParam = parameters.get(XhtmlConstants.EVENT_PARAM);

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TrainRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TrainRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TrainRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TrainRenderer.java
Thu Feb 11 01:13:40 2010
@@ -72,12 +72,16 @@
    */
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    @SuppressWarnings("unused")
+    String       clientId)
   {
     Map<String, String> requestMap =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object event = requestMap.get(XhtmlConstants.EVENT_PARAM);
 
@@ -85,7 +89,7 @@
     {
       Object source = requestMap.get(XhtmlConstants.SOURCE_PARAM);
 
-      if (source != null && source.equals(component.getClientId(context)))
+      if (source != null && source.equals(component.getClientId(facesContext)))
       {
 
         Object valueObject = requestMap.get(XhtmlConstants.VALUE_PARAM);

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/TreeTableRenderer.java
Thu Feb 11 01:13:40 2010
@@ -90,17 +90,21 @@
    */
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
-    decodeSelection(context, component);
+    decodeSelection(facesContext, component);
 
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-    if (component.getClientId(context).equals(source))
+    clientId = clientId == null ? component.getClientId(facesContext) : clientId;
+    if (clientId.equals(source))
     {
       UIXTreeTable treeTable = (UIXTreeTable) component;
       TreeUtils.decodeExpandEvents(parameters, component,

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandLinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandLinkRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandLinkRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/CommandLinkRenderer.java
Thu Feb 11 01:13:40 2010
@@ -59,13 +59,15 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    FacesBean    facesBean,
+    String       clientId)
   {
-    RequestContext afContext = RequestContext.getCurrentInstance();
+    RequestContext requestContext = RequestContext.getCurrentInstance();
     ReturnEvent returnEvent =
-      afContext.getDialogService().getReturnEvent(component);
+      requestContext.getDialogService().getReturnEvent(component);
     if (returnEvent != null)
     {
       returnEvent.queue();
@@ -73,17 +75,20 @@
     else
     {
       Map<String, String> parameterMap =
-        context.getExternalContext().getRequestParameterMap();
+        facesContext.getExternalContext().getRequestParameterMap();
 
       Object source = parameterMap.get("source");
-      String clientId = component.getClientId(context);
+      if (clientId == null)
+      {
+        clientId = component.getClientId(facesContext);
+      }
 
       if ((source != null) && source.equals(clientId))
       {
         (new ActionEvent(component)).queue();
-        if (getPartialSubmit(component, getFacesBean(component)))
+        if (getPartialSubmit(component, facesBean))
         {
-          PartialPageUtils.forcePartialRendering(context);
+          PartialPageUtils.forcePartialRendering(facesContext);
         }
       }
     }

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/EditableValueRenderer.java
Thu Feb 11 01:13:40 2010
@@ -64,26 +64,36 @@
   // DECODING IMPLEMENTATION
   //
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
-    if (skipDecode(context))
+    if (skipDecode(facesContext))
       return;
 
     Object submittedValue;
-    if (!wasSubmitted(context, component))
+    if (!wasSubmitted(facesContext, component))
       submittedValue = null;
     else
-      submittedValue = getSubmittedValue(context,
-                                         component,
-                                         component.getClientId(context));
+    {
+      if (clientId == null)
+      {
+        clientId = component.getClientId(facesContext);
+      }
+      submittedValue = getSubmittedValue(facesContext, component, clientId);
+    }
 
     if (_LOG.isFinest())
     {
+      if (clientId == null)
+      {
+        clientId = component.getClientId(facesContext);
+      }
       _LOG.finest("Value submitted for ID {0} is {1}",
-                  new Object[]{component.getClientId(context),
-                               submittedValue});
+        new Object[]{clientId, submittedValue});
     }
 
     EditableValueHolder evh = (EditableValueHolder) component;

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
Thu Feb 11 01:13:40 2010
@@ -68,18 +68,27 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> paramMap =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object formName = paramMap.get(CoreResponseStateManager.FORM_FIELD_NAME);
     boolean submitted = false;
 
     if ( formName != null )
-      submitted = formName.equals(getClientId(context, component));
+    {
+      if (clientId == null)
+      {
+        clientId = getClientId(facesContext, component);
+      }
+      submitted = formName.equals(clientId);
+    }
 
     // We use this decode for both our form and UIForm
     if (component instanceof UIForm)

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/InputLabelAndMessageRenderer.java
Thu Feb 11 01:13:40 2010
@@ -53,11 +53,15 @@
   }
 
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    @SuppressWarnings("unused")
+    String       clientId)
   {
-     getFormInputRenderer().decode(context, component);
+     getFormInputRenderer().decode(facesContext, component);
   }
 
   @Override

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelAccordionRenderer.java
Thu Feb 11 01:13:40 2010
@@ -63,19 +63,22 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object event = parameters.get(XhtmlConstants.EVENT_PARAM);
     if (XhtmlConstants.HIDE_EVENT.equals(event) ||
         XhtmlConstants.SHOW_EVENT.equals(event))
     {
       Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-      String id = component.getClientId(context);
+      String id = clientId == null ? component.getClientId(facesContext) : clientId;
 
       if (id.equals(source))
       {
@@ -95,7 +98,7 @@
             if (!child.isRendered() || _isItemDisabled(child))
               continue;
 
-            if (itemId.equals(child.getClientId(context)))
+            if (itemId.equals(child.getClientId(facesContext)))
             {
               (new DisclosureEvent(child, isDisclosed)).queue();
               RequestContext rc = RequestContext.getCurrentInstance();
@@ -105,7 +108,7 @@
               if ((cap != null) && (Boolean.TRUE.equals(cap)))
               {
                 RequestContext.getCurrentInstance().addPartialTarget(component);
-                PartialPageUtils.forcePartialRendering(context);
+                PartialPageUtils.forcePartialRendering(facesContext);
               }
 
               break;

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PollRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PollRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PollRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PollRenderer.java
Thu Feb 11 01:13:40 2010
@@ -49,23 +49,26 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object event = parameters.get(XhtmlConstants.EVENT_PARAM);
     if (XhtmlConstants.POLL_EVENT.equals(event))
     {
       Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-      String id = component.getClientId(context);
+      String id = clientId == null ? component.getClientId(facesContext) : clientId;
 
       if (id.equals(source))
       {
         // This component always uses PPR (unless not supported at all)
-        PartialPageUtils.forcePartialRendering(context);
+        PartialPageUtils.forcePartialRendering(facesContext);
 
         // And forcibly re-render ourselves - because that's how
         // we get the poll re-started
@@ -74,7 +77,7 @@
         UIXPoll poll = (UIXPoll) component;
         (new PollEvent(component)).queue();
         if (poll.isImmediate())
-          context.renderResponse();
+          facesContext.renderResponse();
       }
     }
   }

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectRangeChoiceBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectRangeChoiceBarRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectRangeChoiceBarRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectRangeChoiceBarRenderer.java
Thu Feb 11 01:13:40 2010
@@ -75,12 +75,15 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object event = parameters.get(XhtmlConstants.EVENT_PARAM);
 
@@ -88,7 +91,7 @@
     if (XhtmlConstants.GOTO_EVENT.equals(event))
     {
       Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-      String id = component.getClientId(context);
+      String id = clientId == null ? component.getClientId(facesContext) : clientId;
       if (id.equals(source))
       {
         UIXSelectRange choiceBar = (UIXSelectRange)component;
@@ -97,7 +100,7 @@
         rce.queue();
 
         if (choiceBar.isImmediate())
-          context.renderResponse();
+          facesContext.renderResponse();
 
         RequestContext.getCurrentInstance().addPartialTarget(component);
       }

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailHeaderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailHeaderRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailHeaderRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailHeaderRenderer.java
Thu Feb 11 01:13:40 2010
@@ -51,12 +51,16 @@
   }
 
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    @SuppressWarnings("unused")
+    String       clientId)
   {
     // Delegate decoding to the showDetail renderer
-    _detailRenderer.decode(context, component);
+    _detailRenderer.decode(facesContext, component);
   }
 
   @Override

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailItemRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailItemRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailItemRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ShowDetailItemRenderer.java
Thu Feb 11 01:13:40 2010
@@ -58,19 +58,22 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     Object event = parameters.get(XhtmlConstants.EVENT_PARAM);
     if (XhtmlConstants.HIDE_EVENT.equals(event) ||
         XhtmlConstants.SHOW_EVENT.equals(event))
     {
       Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-      String id = component.getClientId(context);
+      String id = clientId == null ? component.getClientId(facesContext) : clientId;
 
       if (id.equals(source))
       {

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SimpleInputListOfValuesRenderer.java
Thu Feb 11 01:13:40 2010
@@ -70,11 +70,14 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
-    super.decode(context, component);
+    super.decode(facesContext, component, facesBean, clientId);
 
     RequestContext afContext = RequestContext.getCurrentInstance();
     // See if a ReturnEvent is waiting for us.  We don't deliver
@@ -84,15 +87,15 @@
     if (returnEvent != null)
     {
       afContext.addPartialTarget(component);
-      queueReturnEvent(context, component, returnEvent);
+      queueReturnEvent(facesContext, component, returnEvent);
     }
     else
     {
       Map<String, String> parameterMap =
-        context.getExternalContext().getRequestParameterMap();
+        facesContext.getExternalContext().getRequestParameterMap();
 
       Object source = parameterMap.get("source");
-      String clientId = component.getClientId(context);
+      clientId = clientId == null ? component.getClientId(facesContext) : clientId;
       if ((source != null) && source.equals(clientId))
       {
         Object part = parameterMap.get(_PART_PARAMETER);
@@ -101,11 +104,11 @@
           // Force partial rendering (if we're launching a window)
           // =-=AEW I don't believe this is necessary;  I believe
           // we've already got "partial" turned on
-          TrinidadAgent agent = AgentUtil.getAgent(context);
+          TrinidadAgent agent = AgentUtil.getAgent(facesContext);
           if (XhtmlUtils.supportsSeparateWindow(agent))
-            PartialPageUtils.forcePartialRendering(context);
+            PartialPageUtils.forcePartialRendering(facesContext);
 
-          queueActionEvent(context, component);
+          queueActionEvent(facesContext, component);
         }
         // else ???
       }

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SingleStepButtonBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SingleStepButtonBarRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SingleStepButtonBarRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SingleStepButtonBarRenderer.java
Thu Feb 11 01:13:40 2010
@@ -63,15 +63,18 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     String source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-    String id = getClientId(context, component);
+    String id = clientId == null ? getClientId(facesContext, component) : clientId;
     if ((source != null) && source.startsWith(id))
     {
       // queue the action on the singleStep component

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TableRenderer.java
Thu Feb 11 01:13:40 2010
@@ -99,17 +99,20 @@
 
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
-    decodeSelection(context, component);
+    decodeSelection(facesContext, component);
 
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
 
     String source = parameters.get(XhtmlConstants.SOURCE_PARAM);
-    String id = component.getClientId(context);
+    String id = clientId == null ? component.getClientId(facesContext) : clientId;
     if (!id.equals(source))
       return;
 

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/TreeRenderer.java
Thu Feb 11 01:13:40 2010
@@ -83,15 +83,22 @@
    */
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     Map<String, String> parameters =
-      context.getExternalContext().getRequestParameterMap();
+      facesContext.getExternalContext().getRequestParameterMap();
     String source = parameters.get(XhtmlConstants.SOURCE_PARAM);
 
-    if (!component.getClientId(context).equals(source))
+    if (clientId == null)
+    {
+      clientId = getClientId(facesContext, component);
+    }
+    if (!clientId.equals(source))
       return;
 
     TreeUtils.decodeExpandEvents(parameters, component,

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
Thu Feb 11 01:13:40 2010
@@ -58,18 +58,21 @@
   //
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    String       clientId)
   {
     UIXCollection table = (UIXCollection) component;
     Object oldKey = table.getRowKey();
 
     table.setRowIndex(-1);
-    String tableId = table.getClientId(context);
+    String tableId = clientId == null ? table.getClientId(facesContext) : clientId;
 
     Map<String, String[]> parameters =
-      context.getExternalContext().getRequestParameterValuesMap();
+      facesContext.getExternalContext().getRequestParameterValuesMap();
 
     String[] unselectedBoxes =
       parameters.get(tableId+NamingContainer.SEPARATOR_CHAR+UNSELECTED_KEY);

Modified: myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java?rev=908782&r1=908781&r2=908782&view=diff
==============================================================================
--- myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java
(original)
+++ myfaces/trinidad/branches/ar-1715/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectOneRenderer.java
Thu Feb 11 01:13:40 2010
@@ -63,9 +63,13 @@
   //
   @SuppressWarnings("unchecked")
   @Override
-  public void decode(
-    FacesContext context,
-    UIComponent  component)
+  protected void decode(
+    FacesContext facesContext,
+    UIComponent  component,
+    @SuppressWarnings("unused")
+    FacesBean    facesBean,
+    @SuppressWarnings("unused")
+    String       clientId)
   {
     UIXCollection table = (UIXCollection) component;
     Object oldKey = table.getRowKey();
@@ -75,10 +79,10 @@
       // Set the row key to null to force the clientId to be correct
       table.setRowKey(null);
 
-      String selectionParam = __getSelectionParameterName(context, table);
+      String selectionParam = __getSelectionParameterName(facesContext, table);
 
       Map<String, String> parameters =
-        context.getExternalContext().getRequestParameterMap();
+        facesContext.getExternalContext().getRequestParameterMap();
 
       _LOG.finest("Params:{0}", parameters);
 



Mime
View raw message