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 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.
 String getAction()
          Return the Struts action path to which this form should be submitted.
 String getEnctype()
          Return the encoding type for this form submit.
 String getFamily()
          Return the component family to which this component belongs.
 String getFocus()
          Return the focus element name.
 String getFocusIndex()
          Return the focus element index.
 String getOnreset()
          Return the JavaScript to execute on form reset.
 String getOnsubmit()
          Return the JavaScript to execute on form submit.
 String getStyle()
          Return the CSS style(s) to be rendered for this component.
 String getStyleClass()
          Return the CSS style class(es) to be rendered for this component.
 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, Object state)
          Restore our state from the specified object.
 Object saveState(javax.faces.context.FacesContext context)
          Create and return an object representing our state to be saved.
 void setAction(String action)
          Set the Struts action to which this form should be submitted.
 void setEnctype(String enctype)
          Set the encoding type for this form submit.
 void setFocus(String focus)
          Set the focus element name.
 void setFocusIndex(String focusIndex)
          Set the focus element index.
 void setOnreset(String onreset)
          Set the JavaScript to execute on form reset.
 void setOnsubmit(String onsubmit)
          Set the JavaScript to execute on form submit.
 void setStyle(String style)
          Set the CSS style(s) to be rendered for this component.
 void setStyleClass(String styleClass)
          Set the CSS style class(es) to be rendered for this component.
 void setTarget(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 Log log

The Log instance for this class.

Constructor Detail

FormComponent

public FormComponent()
Method Detail

getAction

public String getAction()

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


setAction

public void setAction(String action)

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

Parameters:
action - The new action path

getEnctype

public String getEnctype()

Return the encoding type for this form submit.


setEnctype

public void setEnctype(String enctype)

Set the encoding type for this form submit.

Parameters:
enctype - The new enctype path

getFamily

public String getFamily()

Return the component family to which this component belongs.

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

getFocus

public String getFocus()

Return the focus element name.


setFocus

public void setFocus(String focus)

Set the focus element name.

Parameters:
focus - The new focus path

getFocusIndex

public String getFocusIndex()

Return the focus element index.


setFocusIndex

public void setFocusIndex(String focusIndex)

Set the focus element index.

Parameters:
focusIndex - The new focusIndex path

getOnreset

public String getOnreset()

Return the JavaScript to execute on form reset.


setOnreset

public void setOnreset(String onreset)

Set the JavaScript to execute on form reset.

Parameters:
onreset - The new onreset path

getOnsubmit

public String getOnsubmit()

Return the JavaScript to execute on form submit.


setOnsubmit

public void setOnsubmit(String onsubmit)

Set the JavaScript to execute on form submit.

Parameters:
onsubmit - The new onsubmit path

getStyle

public String getStyle()

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


setStyle

public void setStyle(String style)

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

Parameters:
style - The new CSS style(s)

getStyleClass

public String getStyleClass()

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


setStyleClass

public void setStyleClass(String styleClass)

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

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

getTarget

public String getTarget()

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


setTarget

public void setTarget(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,
                         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 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:
IllegalArgumentException - if no ActionConfig for the specified action attribute can be located
IllegalArgumentException - if no FormBeanConfig for the specified form bean can be located
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:
IllegalArgumentException - if no ModuleConfig can be found


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