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/03/11 14:37:19 UTC

svn commit: r1734554 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml

Author: lofwyr
Date: Fri Mar 11 13:37:19 2016
New Revision: 1734554

URL: http://svn.apache.org/viewvc?rev=1734554&view=rev
Log:
TOBAGO-1524: Use standard ajax mechanism
* set active form in AJAX case

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java?rev=1734554&r1=1734553&r2=1734554&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java Fri Mar 11 13:37:19 2016
@@ -30,6 +30,8 @@ import javax.faces.component.ContextCall
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIForm;
 import javax.faces.context.FacesContext;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
 import java.util.Iterator;
 
@@ -45,7 +47,7 @@ public abstract class AbstractUIForm ext
 
     // Process this component first
     // to know the active actionId
-    // for the following childrend
+    // for the following children
     decode(facesContext);
 
     final Iterator kids = getFacetsAndChildren();
@@ -106,6 +108,17 @@ public abstract class AbstractUIForm ext
   }
 
   @Override
+  public void queueEvent(FacesEvent event) {
+    if (event instanceof AjaxBehaviorEvent) {
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("event={}", event);
+      }
+      setSubmitted(true);
+    }
+    super.queueEvent(event);
+  }
+
+  @Override
   public boolean invokeOnComponent(final FacesContext context, final String clientId, final ContextCallback callback)
       throws FacesException {
     // TODO is this needed?

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml?rev=1734554&r1=1734553&r2=1734554&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/01-basic/00/input.xhtml Fri Mar 11 13:37:19 2016
@@ -41,11 +41,15 @@
 
     <tc:out value="FIXME: AJAX example currently not working correctly: In.setChangeValue() will not be called."/>
 
-    <tc:in id="i6" value="#{in.changeValue}" label="on change">
-      <f:ajax render="panel" listener="#{in.update}"/>
-    </tc:in>
+    <tc:panel id="panel">
 
-    <tc:out id="o" value="#{in.changeValue}" label="value on server"/>
+      <tc:in id="i6" value="#{in.changeValue}" label="on change">
+        <f:ajax render="panel" listener="#{in.update}"/>
+      </tc:in>
+
+      <tc:out id="o" value="#{in.changeValue}" label="value on server"/>
+
+    </tc:panel>
 
     <tc:in id="i7" label="Input (focus)" focus="true" value="Some Text"/>