myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r740928 - in /myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets: TabChangeListenerHandler.java TabChangeSourceRule.java
Date Wed, 04 Feb 2009 22:42:02 GMT
Author: bommel
Date: Wed Feb  4 22:42:02 2009
New Revision: 740928

URL: http://svn.apache.org/viewvc?rev=740928&view=rev
Log:
(TOBAGO-741) TabChangeListener doesn't work with facelets

Modified:
    myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
    myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java

Modified: myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java?rev=740928&r1=740927&r2=740928&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
(original)
+++ myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
Wed Feb  4 22:42:02 2009
@@ -23,12 +23,15 @@
 import com.sun.facelets.tag.TagAttributeException;
 import com.sun.facelets.tag.TagException;
 import com.sun.facelets.FaceletContext;
+import com.sun.facelets.el.LegacyValueBinding;
+import com.sun.facelets.util.FacesAPI;
 
 import java.io.IOException;
 
 import org.apache.myfaces.tobago.event.TabChangeSource;
 import org.apache.myfaces.tobago.event.TabChangeListener;
 import org.apache.myfaces.tobago.event.ValueExpressionTabChangeListener;
+import org.apache.myfaces.tobago.event.ValueBindingTabChangeListener;
 
 import javax.faces.FacesException;
 import javax.faces.component.UIComponent;
@@ -36,7 +39,6 @@
 import javax.el.ELException;
 
 /*
- * User: bommel
  * Date: 20.04.2006
  * Time: 18:14:11
  */
@@ -88,7 +90,12 @@
           }
         }
         if (valueExpression != null) {
-          changeSource.addTabChangeListener(new ValueExpressionTabChangeListener(type.getValue(),
valueExpression));
+          if (FacesAPI.getVersion() >= 12) {
+            changeSource.addTabChangeListener(new ValueExpressionTabChangeListener(type.getValue(),
valueExpression));
+          } else {
+            changeSource.addTabChangeListener(new ValueBindingTabChangeListener(type.getValue(),
+                new LegacyValueBinding(valueExpression)));
+          }
         } else {
           changeSource.addTabChangeListener(listener);
         }

Modified: myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java?rev=740928&r1=740927&r2=740928&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java
(original)
+++ myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java
Wed Feb  4 22:42:02 2009
@@ -33,7 +33,7 @@
  */
 public class TabChangeSourceRule extends MetaRule {
   static final Class[] ACTION_LISTENER = new Class[]{TabChangeEvent.class};
-  public static final SortActionSourceRule INSTANCE = new SortActionSourceRule();
+  public static final TabChangeSourceRule INSTANCE = new TabChangeSourceRule();
 
   public Metadata applyRule(String name, TagAttribute attribute,
       MetadataTarget metadataTarget) {



Mime
View raw message