org.apache.myfaces.renderkit.html.util
Class DummyFormUtils

java.lang.Object
  extended by org.apache.myfaces.renderkit.html.util.DummyFormUtils

public class DummyFormUtils
extends Object

Many JSF components can be used without an enclosing h:form. In this case, they need a dummy form to store data into and submit when communication with the server is necessary. These components can use methods on the DummyFormRequestInfo object accessable via this class to register parameters and get the name of a form to submit.

Only one dummy form will be rendered into the response.

Version:
$Revision: 491777 $ $Date: 2007-01-02 06:27:11 -0500 (Tue, 02 Jan 2007) $
Author:
Manfred Geiler (latest modification by $Author: paulsp $), Bruno Aranda

Field Summary
static String DUMMY_FORM_INFO
          Used to store the instance of DummyFormRequestInfo in the request map
static String DUMMY_FORM_NAME
           
 
Constructor Summary
DummyFormUtils()
           
 
Method Summary
static void addDummyFormParameter(javax.faces.context.FacesContext facesContext, String paramName)
          Delegator method to add a parameter to the DummyFormRequestInfo object in the request
static org.apache.myfaces.shared_tomahawk.renderkit.html.util.FormInfo findNestingForm(javax.faces.component.UIComponent uiComponent, javax.faces.context.FacesContext facesContext)
           
static String getDummyFormName()
           
static Set getDummyFormParameters(javax.faces.context.FacesContext facesContext)
           
static boolean isWriteDummyForm(javax.faces.context.FacesContext facesContext)
          Checks if the DummyFormRequestInfo is already in the request map.
static void setWriteDummyForm(javax.faces.context.FacesContext facesContext, boolean writeDummyForm)
          When writeDummyForm is set to true, a DummyFormRequestInfo object will be instantiated and put in the request.
static void writeDummyForm(javax.faces.context.ResponseWriter writer, Set dummyFormParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMMY_FORM_NAME

public static final String DUMMY_FORM_NAME
See Also:
Constant Field Values

DUMMY_FORM_INFO

public static final String DUMMY_FORM_INFO
Used to store the instance of DummyFormRequestInfo in the request map

Constructor Detail

DummyFormUtils

public DummyFormUtils()
Method Detail

getDummyFormName

public static String getDummyFormName()

setWriteDummyForm

public static void setWriteDummyForm(javax.faces.context.FacesContext facesContext,
                                     boolean writeDummyForm)
When writeDummyForm is set to true, a DummyFormRequestInfo object will be instantiated and put in the request. Later, if this object is found, the dummyForm javascript will be rendered in the page before the end of the body tag

Parameters:
facesContext -
writeDummyForm -

isWriteDummyForm

public static boolean isWriteDummyForm(javax.faces.context.FacesContext facesContext)
Checks if the DummyFormRequestInfo is already in the request map.

Parameters:
facesContext -
Returns:
boolean true, if dummy form is to be written

addDummyFormParameter

public static void addDummyFormParameter(javax.faces.context.FacesContext facesContext,
                                         String paramName)
Delegator method to add a parameter to the DummyFormRequestInfo object in the request

Parameters:
facesContext -
paramName -

getDummyFormParameters

public static Set getDummyFormParameters(javax.faces.context.FacesContext facesContext)

writeDummyForm

public static void writeDummyForm(javax.faces.context.ResponseWriter writer,
                                  Set dummyFormParams)
                           throws IOException
Throws:
IOException

findNestingForm

public static org.apache.myfaces.shared_tomahawk.renderkit.html.util.FormInfo findNestingForm(javax.faces.component.UIComponent uiComponent,
                                                                                              javax.faces.context.FacesContext facesContext)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.