You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mk...@apache.org on 2006/04/21 18:18:38 UTC

svn commit: r395926 - /myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java

Author: mkienenb
Date: Fri Apr 21 09:18:35 2006
New Revision: 395926

URL: http://svn.apache.org/viewcvs?rev=395926&view=rev
Log:
Fix for MYFACES-1276 by Andrew Robinson.   We'll give this a try, but if it causes tck problems, we'll have to pull it back out.   I don't see anything that would indicate such a problem exists currently, though.

Modified:
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
URL: http://svn.apache.org/viewcvs/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java?rev=395926&r1=395925&r2=395926&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java Fri Apr 21 09:18:35 2006
@@ -69,6 +69,12 @@
         HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_PASSTHROUGH_ATTRIBUTES);
 
         writer.write(""); // force start element tag to be closed
+
+        // not needed in this version as nothing is written to the form tag, but
+        // included for backward compatibility to the 1.1.1 patch (JIRA MYFACES-1276)
+        // However, might be needed in the future
+        beforeFormElementsStart(facesContext, component);
+        afterFormElementsStart(facesContext, component);
     }
 
 
@@ -77,6 +83,8 @@
     {
         ResponseWriter writer = facesContext.getResponseWriter();
 
+        beforeFormElementsEnd(facesContext, component);
+
         //write hidden input to determine "submitted" value on decode
         writer.startElement(HTML.INPUT_ELEM, component);
         writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
@@ -126,6 +134,7 @@
         ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
         viewHandler.writeState(facesContext);
 
+        afterFormElementsEnd(facesContext, component);
         writer.endElement(HTML.FORM_ELEM);
     }
 
@@ -168,4 +177,35 @@
         set.add(paramName);
     }
 
+    /**
+     * Called before the state and any elements are added to the form tag in the
+     * encodeBegin method
+     */
+    protected void beforeFormElementsStart(FacesContext facesContext, UIComponent component)
+            throws IOException
+    {}
+
+    /**
+     * Called after the state and any elements are added to the form tag in the
+     * encodeBegin method
+     */
+    protected void afterFormElementsStart(FacesContext facesContext, UIComponent component)
+            throws IOException
+    {}
+
+    /**
+     * Called before the state and any elements are added to the form tag in the
+     * encodeEnd method
+     */
+    protected void beforeFormElementsEnd(FacesContext facesContext, UIComponent component)
+            throws IOException
+    {}
+
+    /**
+     * Called after the state and any elements are added to the form tag in the
+     * encodeEnd method
+     */
+    protected void afterFormElementsEnd(FacesContext facesContext, UIComponent component)
+            throws IOException
+    {}
 }