You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/03/08 15:09:14 UTC
svn commit: r1785981 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
Author: lofwyr
Date: Wed Mar 8 15:09:14 2017
New Revision: 1785981
URL: http://svn.apache.org/viewvc?rev=1785981&view=rev
Log:
TOBAGO-1699: f:ajax doesn't work within a h:commandLink
* Using a different rendererType for <f:ajax> in Tobago components called by any TobagoRenderer
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java?rev=1785981&r1=1785980&r2=1785981&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/RenderUtils.java Wed Mar 8 15:09:14 2017
@@ -36,6 +36,7 @@ import javax.faces.component.EditableVal
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
import javax.faces.component.ValueHolder;
+import javax.faces.component.behavior.AjaxBehavior;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorBase;
import javax.faces.component.behavior.ClientBehaviorContext;
@@ -258,7 +259,11 @@ public final class RenderUtils {
facesContext, (UIComponent) holder, key, ((UIComponent) holder).getClientId(facesContext), null);
for (ClientBehavior clientBehavior : behaviorMap.getValue()) {
if (clientBehavior instanceof ClientBehaviorBase) {
- final String type = ((ClientBehaviorBase) clientBehavior).getRendererType();
+ String type = ((ClientBehaviorBase) clientBehavior).getRendererType();
+ // XXX this is to use a different renderer for Tobago components and other components.
+ if (type.equals(AjaxBehavior.BEHAVIOR_ID)) {
+ type = "org.apache.myfaces.tobago.behavior.Ajax";
+ }
final ClientBehaviorRenderer renderer = facesContext.getRenderKit().getClientBehaviorRenderer(type);
final String dummy = renderer.getScript(context, clientBehavior);
if (dummy != null) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java?rev=1785981&r1=1785980&r2=1785981&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java Wed Mar 8 15:09:14 2017
@@ -211,7 +211,8 @@ public class FacesConfigGenerator extend
final org.jdom.Element behaviorRender = new org.jdom.Element(CLIENT_BEHAVIOR_RENDERER, namespace);
final org.jdom.Element behaviorType = new org.jdom.Element(CLIENT_BEHAVIOR_RENDERER_TYPE, namespace);
- behaviorType.setText("javax.faces.behavior.Ajax");
+// behaviorType.setText("javax.faces.behavior.Ajax");
+ behaviorType.setText("org.apache.myfaces.tobago.behavior.Ajax");
behaviorRender.addContent(behaviorType);
final org.jdom.Element behaviorClass = new org.jdom.Element(CLIENT_BEHAVIOR_RENDERER_CLASS, namespace);
behaviorClass.setText("org.apache.myfaces.tobago.internal.renderkit.renderer.TobagoClientBehaviorRenderer");