You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2005/12/09 01:03:08 UTC

svn commit: r355288 - /myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java

Author: skitching
Date: Thu Dec  8 16:02:50 2005
New Revision: 355288

URL: http://svn.apache.org/viewcvs?rev=355288&view=rev
Log:
Added javadoc only

Modified:
    myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java?rev=355288&r1=355287&r2=355288&view=diff
==============================================================================
--- myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java Thu Dec  8 16:02:50 2005
@@ -55,10 +55,12 @@
     }
 
     /**
-     * X-CHECKED: tlddoc h:inputText
-     *
-     * @param facesContext
-     * @param component
+     * Utility to set the submitted value of the provided component from the
+     * data in the current request object.
+     * <p>
+     * Param component is required to be an EditableValueHolder. On return
+     * from this method, the component's submittedValue property will be
+     * set if the submitted form contained that component.
      */
     public static void decodeUIInput(FacesContext facesContext,
                                      UIComponent component) {
@@ -81,7 +83,10 @@
         }
         else
         {
-            log.warn("There should always be a submitted value for an input if it is rendered, its form is submitted, and it is not disabled or read-only. Component : "+
+            log.warn(
+                "There should always be a submitted value for an input if it"
+                + " is rendered, its form is submitted, and it is not disabled"
+                + " or read-only. Component : "+
                     RendererUtils.getPathToComponent(component));
         }
     }
@@ -925,6 +930,16 @@
                 + JavascriptUtils.getValidJavascriptName(formName, false);
     }
 
+    /**
+     * Return the clientId of the form associated with the specified component.
+     * <p>
+     * If the component is nested within a UIForm, that component's id is returned.
+     * <p>
+     * Otherwise the component of the "dummy form" is returned. At most one dummy
+     * form is output into each page; all components which can cause page submission
+     * but are not nested within a real form will cause the dummy form to be
+     * submitted instead.
+     */
     public static String getFormName(UIComponent component, FacesContext context) {
         //Find form
         UIComponent parent = component.getParent();
@@ -941,6 +956,22 @@
         return DummyFormUtils.DUMMY_FORM_NAME;
     }
 
+    /**
+     * Get the name of the request parameter that holds the id of the
+     * link-type component that caused the form to be submitted.
+     * <p>
+     * Within each page there may be multiple "link" type components that
+     * cause page submission. On the server it is necessary to know which
+     * of these actually caused the submit, in order to invoke the correct
+     * listeners. Such components therefore store their id into the
+     * "hidden command link field" in their associated form before 
+     * submitting it. 
+     * <p>
+     * The field is always a direct child of each form, and has the same
+     * <i>name</i> in each form. The id of the form component is therefore
+     * both necessary and sufficient to determine the full name of the
+     * field.
+     */
     public static String getHiddenCommandLinkFieldName(String formName) {
         return formName + NamingContainer.SEPARATOR_CHAR
                 + HIDDEN_COMMANDLINK_FIELD_NAME;