FAQ
Author: lofwyr
Date: Fri Jun 10 15:37:06 2016
New Revision: 1747736

URL: http://svn.apache.org/viewvc?rev=1747736&view=rev
Log:
TOBAGO-1568: Working on multi-form behavior

Modified:
     myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
     myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java
     myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.xhtml
     myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FormRenderer.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java?rev=1747736&r1=1747735&r2=1747736&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIForm.java Fri Jun 10 15:37:06 2016
@@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory;
  import javax.faces.component.UIComponent;
  import javax.faces.component.UIForm;
  import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
  import javax.faces.event.AjaxBehaviorEvent;
  import javax.faces.event.FacesEvent;
  import java.util.Iterator;
@@ -106,7 +105,7 @@ public abstract class AbstractUIForm ext
    @Override
    public void queueEvent(final FacesEvent event) {

- if (event instanceof ActionEvent || event instanceof AjaxBehaviorEvent || isWrapped(event)) {
+ if (event instanceof AjaxBehaviorEvent || isWrapped(event)) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("processing event={}", event);
        }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java?rev=1747736&r1=1747735&r2=1747736&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/FormTagDeclaration.java Fri Jun 10 15:37:06 2016
@@ -27,6 +27,12 @@ import org.apache.myfaces.tobago.interna

  import javax.faces.component.UIForm;

+/**
+ * If an action is preformed, everything within the next parent form belongs to the submit-area.
+ * An action could be a button which is pressed.
+ * tc:page is a form.
+ * Everything in the submit-area is written into the model, even other forms.
+ */
  @Tag(name = "form")
  @UIComponentTag(
      uiComponent = "org.apache.myfaces.tobago.component.UIForm",

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.xhtml?rev=1747736&r1=1747735&r2=1747736&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/30-concept/08-form/10-required/form-required.xhtml Fri Jun 10 15:37:06 2016
@@ -53,16 +53,16 @@
  &lt;/tc:box></code></pre>

      <tc:box label="Outer Form">
- <tc:form>
+ <tc:form id="outer">
          <tc:box label="Inner Form 1">
- <tc:form>
+ <tc:form id="inner1">
              <tc:in id="innervalue1in" label="Inner Value 1" value="#{formRequiredController.innerValue1}"/>
              <tc:out id="innervalue1out" label="Inner Value 1 in Model" value="#{formRequiredController.innerValue1}"/>
              <tc:button label="Submit"/>
            </tc:form>
          </tc:box>
          <tc:box label="Inner Form 2">
- <tc:form>
+ <tc:form id="inner2">
              <tc:in id="innervalue2in" label="Inner Value 2" required="true"
                     value="#{formRequiredController.innerValue2}"/>
              <tc:out id="innervalue2out" label="Inner Value 2 in Model" value="#{formRequiredController.innerValue2}"/>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FormRenderer.java?rev=1747736&r1=1747735&r2=1747736&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FormRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FormRenderer.java Fri Jun 10 15:37:06 2016
@@ -20,22 +20,21 @@
  package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;

  import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

  import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
  import javax.faces.context.FacesContext;

  public class FormRenderer extends RendererBase {

+ private static final Logger LOG = LoggerFactory.getLogger(FormRenderer.class);
+
    @Override
    public void decode(final FacesContext facesContext, final UIComponent component) {
- final UIForm form = (UIForm) component;
- final String sourceId = facesContext.getExternalContext().getRequestParameterMap().get("javax.faces.source");
- final String clientId = form.getClientId(facesContext);
- if (sourceId != null && sourceId.startsWith(clientId)) {
- form.setSubmitted(true);
- }
- super.decode(facesContext, form);
+
+ LOG.info("Do nothing spectial in form '{}'", component.getClientId(facesContext));
+
+ super.decode(facesContext, component);
    }
  }
-

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categoriesmyfaces
postedJun 10, '16 at 3:37p
activeJun 10, '16 at 3:37p
posts1
users1
websitemyfaces.apache.org

1 user in discussion

Lofwyr: 1 post

People

Translate

site design / logo © 2019 Grokbase