org.apache.struts.faces.component
Class FormComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIForm
              extended by org.apache.struts.faces.component.FormComponent
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class FormComponent
extends javax.faces.component.UIForm

FormComponent is a specialized subclass of javax.faces.component.UIForm that supports automatic creation of form beans in request or session scope.

Version:
$Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $

Field Summary
protected static org.apache.commons.logging.Log log
          The Log instance for this class.
 
Fields inherited from class javax.faces.component.UIForm
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
FormComponent()
           
 
Method Summary
 void createActionForm(javax.faces.context.FacesContext context)
          Create an appropriate form bean in the appropriate scope, if one does not already exist.
 java.lang.String getAction()
          Return the Struts action path to which this form should be submitted.
 java.lang.String getEnctype()
          Return the encoding type for this form submit.
 java.lang.String getFamily()
          Return the component family to which this component belongs.
 java.lang.String getFocus()
          Return the focus element name.
 java.lang.String getFocusIndex()
          Return the focus element index.
 java.lang.String getOnreset()
          Return the JavaScript to execute on form reset.
 java.lang.String getOnsubmit()
          Return the JavaScript to execute on form submit.
 java.lang.String getStyle()
          Return the CSS style(s) to be rendered for this component.
 java.lang.String getStyleClass()
          Return the CSS style class(es) to be rendered for this component.
 java.lang.String getTarget()
          Return the target frame for the response to this form submit.
 org.apache.struts.config.ModuleConfig lookupModuleConfig(javax.faces.context.FacesContext context)
          Return the ModuleConfig for the application module this form is being processed for.
 void processDecodes(javax.faces.context.FacesContext context)
          Create an instance of the form bean (if necessary) before delegating to the standard decoding process.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          Restore our state from the specified object.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          Create and return an object representing our state to be saved.
 void setAction(java.lang.String action)
          Set the Struts action to which this form should be submitted.
 void setEnctype(java.lang.String enctype)
          Set the encoding type for this form submit.
 void setFocus(java.lang.String focus)
          Set the focus element name.
 void setFocusIndex(java.lang.String focusIndex)
          Set the focus element index.
 void setOnreset(java.lang.String onreset)
          Set the JavaScript to execute on form reset.
 void setOnsubmit(java.lang.String onsubmit)
          Set the JavaScript to execute on form submit.
 void setStyle(java.lang.String style)
          Set the CSS style(s) to be rendered for this component.
 void setStyleClass(java.lang.String styleClass)
          Set the CSS style class(es) to be rendered for this component.
 void setTarget(java.lang.String target)
          Set the target frame for the response to this form submit.
 
Methods inherited from class javax.faces.component.UIForm
isSubmitted, processUpdates, processValidators, setSubmitted
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

The Log instance for this class.

Constructor Detail

FormComponent

public FormComponent()
Method Detail

getAction

public java.lang.String getAction()

Return the Struts action path to which this form should be submitted.


setAction

public void setAction(java.lang.String action)

Set the Struts action to which this form should be submitted.

Parameters:
action - The new action path

getEnctype

public java.lang.String getEnctype()

Return the encoding type for this form submit.


setEnctype

public void setEnctype(java.lang.String enctype)

Set the encoding type for this form submit.

Parameters:
enctype - The new enctype path

getFamily

public java.lang.String getFamily()

Return the component family to which this component belongs.

Overrides:
getFamily in class javax.faces.component.UIForm

getFocus

public java.lang.String getFocus()

Return the focus element name.


setFocus

public void setFocus(java.lang.String focus)

Set the focus element name.

Parameters:
focus - The new focus path

getFocusIndex

public java.lang.String getFocusIndex()

Return the focus element index.


setFocusIndex

public void setFocusIndex(java.lang.String focusIndex)

Set the focus element index.

Parameters:
focusIndex - The new focusIndex path

getOnreset

public java.lang.String getOnreset()

Return the JavaScript to execute on form reset.


setOnreset

public void setOnreset(java.lang.String onreset)

Set the JavaScript to execute on form reset.

Parameters:
onreset - The new onreset path

getOnsubmit

public java.lang.String getOnsubmit()

Return the JavaScript to execute on form submit.


setOnsubmit

public void setOnsubmit(java.lang.String onsubmit)

Set the JavaScript to execute on form submit.

Parameters:
onsubmit - The new onsubmit path

getStyle

public java.lang.String getStyle()

Return the CSS style(s) to be rendered for this component.


setStyle

public void setStyle(java.lang.String style)

Set the CSS style(s) to be rendered for this component.

Parameters:
style - The new CSS style(s)

getStyleClass

public java.lang.String getStyleClass()

Return the CSS style class(es) to be rendered for this component.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

Set the CSS style class(es) to be rendered for this component.

Parameters:
styleClass - The new CSS style class(es)

getTarget

public java.lang.String getTarget()

Return the target frame for the response to this form submit.


setTarget

public void setTarget(java.lang.String target)

Set the target frame for the response to this form submit.

Parameters:
target - The new CSS target(s)

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)

Create an instance of the form bean (if necessary) before delegating to the standard decoding process.

Overrides:
processDecodes in class javax.faces.component.UIForm
Parameters:
context - FacesContext for the request we are processing

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)

Restore our state from the specified object.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase
Parameters:
context - FacesContext for the current request
state - Object containing our saved state

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)

Create and return an object representing our state to be saved.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIForm
Parameters:
context - FacesContext for the current request

createActionForm

public void createActionForm(javax.faces.context.FacesContext context)

Create an appropriate form bean in the appropriate scope, if one does not already exist.

Parameters:
context - FacesContext for the current request
Throws:
java.lang.IllegalArgumentException - if no ActionConfig for the specified action attribute can be located
java.lang.IllegalArgumentException - if no FormBeanConfig for the specified form bean can be located
java.lang.IllegalArgumentException - if no ModuleConfig can be located for this application module

lookupModuleConfig

public org.apache.struts.config.ModuleConfig lookupModuleConfig(javax.faces.context.FacesContext context)

Return the ModuleConfig for the application module this form is being processed for.

Parameters:
context - The FacesContext for the current request
Throws:
java.lang.IllegalArgumentException - if no ModuleConfig can be found


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.