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 2016/11/16 15:56:32 UTC
svn commit: r1770005 - in /myfaces/tobago/trunk:
tobago-core/src/main/faces-config/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/
tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/
Author: lofwyr
Date: Wed Nov 16 15:56:32 2016
New Revision: 1770005
URL: http://svn.apache.org/viewvc?rev=1770005&view=rev
Log:
TOBAGO-1617: New tag <tc:event> to be similar to <f:ajax> and to replace <tc:command> in facets
* fix position of the event behavior declaration in faces-config.xml
(this fixes a problem with TomEE)
Modified:
myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.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/faces-config/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml?rev=1770005&r1=1770004&r2=1770005&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml Wed Nov 16 15:56:32 2016
@@ -34,6 +34,11 @@
<phase-listener>org.apache.myfaces.tobago.lifecycle.SecretPhaseListener</phase-listener>
</lifecycle>
+ <behavior>
+ <behavior-id>org.apache.myfaces.tobago.behavior.Event</behavior-id>
+ <behavior-class>org.apache.myfaces.tobago.internal.behavior.EventBehavior</behavior-class>
+ </behavior>
+
<component>
<component-type>javax.faces.NamingContainer</component-type>
<component-class>org.apache.myfaces.tobago.component.UINamingContainer</component-class>
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java?rev=1770005&r1=1770004&r2=1770005&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/behavior/EventBehavior.java Wed Nov 16 15:56:32 2016
@@ -33,14 +33,12 @@ import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
-import static org.apache.myfaces.tobago.internal.behavior.EventBehavior.BEHAVIOR_ID;
-
// todo: clean up (is a copy of MyFaces, but not all stuff is refactored)
/**
* @since 3.0.0
*/
-@FacesBehavior(value = BEHAVIOR_ID)
+@FacesBehavior(value = EventBehavior.BEHAVIOR_ID)
public class EventBehavior extends ClientBehaviorBase {
/**
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=1770005&r1=1770004&r2=1770005&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 Nov 16 15:56:32 2016
@@ -209,15 +209,6 @@ public class FacesConfigGenerator extend
renderKit.addContent(renderKitClass);
renderKit.addContent(newRenderer);
- final org.jdom.Element behavior = new org.jdom.Element(BEHAVIOR, namespace);
- final org.jdom.Element behaviorId = new org.jdom.Element(BEHAVIOR_ID, namespace);
- behaviorId.setText("org.apache.myfaces.tobago.behavior.Event");
- behavior.addContent(behaviorId);
- final org.jdom.Element behaviorClass = new org.jdom.Element(BEHAVIOR_CLASS, namespace);
- behaviorClass.setText("org.apache.myfaces.tobago.behavior.EventBehavior");
- behavior.addContent(behaviorClass);
- renderKit.addContent(behavior);
-
final org.jdom.Element clientBehaviorRender = new org.jdom.Element(CLIENT_BEHAVIOR_RENDERER, namespace);
final org.jdom.Element clientBehaviorType = new org.jdom.Element(CLIENT_BEHAVIOR_RENDERER_TYPE, namespace);
clientBehaviorType.setText("javax.faces.behavior.Ajax");
@@ -236,12 +227,12 @@ public class FacesConfigGenerator extend
clientBehaviorRender2.addContent(clientBehaviorClass2);
renderKit.addContent(clientBehaviorRender2);
- final int lastIndex = getIndexAfter(rootElement, CONVERTER, COMPONENT, FACTORY, APPLICATION);
- rootElement.addContent(lastIndex, renderKit);
+ final int last = getIndexAfter(rootElement, CONVERTER, COMPONENT, FACTORY, APPLICATION, BEHAVIOR);
+ rootElement.addContent(last, renderKit);
}
if (!newConverters.isEmpty()) {
- final int lastIndex = getIndexAfter(rootElement, RENDER_KIT, CONVERTER, COMPONENT, FACTORY, APPLICATION);
- rootElement.addContent(lastIndex, newConverters);
+ final int last = getIndexAfter(rootElement, RENDER_KIT, CONVERTER, COMPONENT, FACTORY, APPLICATION, BEHAVIOR);
+ rootElement.addContent(last, newConverters);
}
if (!newValidators.isEmpty()) {
rootElement.addContent(newValidators);