org.jboss.seam.ui.component.html
Class HtmlFileUpload

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by org.jboss.seam.ui.component.UIFileUpload
                      extended by org.jboss.seam.ui.component.html.HtmlFileUpload
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class HtmlFileUpload
extends UIFileUpload

Component-Type org.jboss.seam.ui.FileUpload Component-Family org.jboss.seam.ui.FileUpload Renderer-Type org.jboss.seam.ui.FileUploadRenderer Renders a file upload control. This control must be used within a form with an encoding type of multipart/form-data, i.e: <h:form enctype="multipart/form-data"> For multipart requests, the Seam Multipart servlet filter must also be configured in web.xml: <filter> <filter-name>Seam Filter</filter-name> <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> The following configuration options for multipart requests may be configured in components.xml: createTempFiles - if this option is set to true, uploaded files are streamed to a temporary file instead of in memory. maxRequestSize - the maximum size of a file upload request, in bytes. Here's an example: <component class="org.jboss.seam.servlet.MultipartConfig"> <property name="createTempFiles">true</property> <property name="maxRequestSize">1000000</property> </component>


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
HtmlFileUpload()
          Constructor to init default renderers
 
Method Summary
 java.lang.String getAccept()
          a comma-separated list of content types to accept, may not be supported by the browser.
 java.lang.String getContentType()
          the property to receive the contentType Getter for contentType
 java.lang.Object getData()
          this value binding receives the file's content type (optional).
 java.lang.String getFamily()
           
 java.lang.String getFileName()
          this value binding receives the filename (optional).
 java.lang.Integer getFileSize()
          this value binding receives the file size (optional).
 java.lang.String getStyle()
          CSS style(s) is/are to be applied when this component is rendered Getter for style
 java.lang.String getStyleClass()
          Corresponds to the HTML class attribute Getter for styleClass
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAccept(java.lang.String __accept)
          a comma-separated list of content types to accept, may not be supported by the browser.
 void setContentType(java.lang.String __contentType)
          the property to receive the contentType Setter for contentType
 void setData(java.lang.Object __data)
          this value binding receives the file's content type (optional).
 void setFileName(java.lang.String __fileName)
          this value binding receives the filename (optional).
 void setFileSize(java.lang.Integer __fileSize)
          this value binding receives the file size (optional).
 void setStyle(java.lang.String __style)
          CSS style(s) is/are to be applied when this component is rendered Setter for style
 void setStyleClass(java.lang.String __styleClass)
          Corresponds to the HTML class attribute Setter for styleClass
 
Methods inherited from class org.jboss.seam.ui.component.UIFileUpload
getLocalContentType, getLocalFileName, getLocalFileSize, getLocalInputStream, processUpdates, setLocalContentType, setLocalFileName, setLocalFileSize, setLocalInputStream
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

HtmlFileUpload

public HtmlFileUpload()
Constructor to init default renderers

Method Detail

setFileSize

public void setFileSize(java.lang.Integer __fileSize)
this value binding receives the file size (optional). Setter for fileSize

Parameters:
fileSize - - new value

getFileSize

public java.lang.Integer getFileSize()
this value binding receives the file size (optional). Getter for fileSize

Returns:
fileSize value from local variable or value bindings

setStyleClass

public void setStyleClass(java.lang.String __styleClass)
Corresponds to the HTML class attribute Setter for styleClass

Specified by:
setStyleClass in class UIFileUpload
Parameters:
styleClass - - new value

getStyleClass

public java.lang.String getStyleClass()
Corresponds to the HTML class attribute Getter for styleClass

Specified by:
getStyleClass in class UIFileUpload
Returns:
styleClass value from local variable or value bindings

setStyle

public void setStyle(java.lang.String __style)
CSS style(s) is/are to be applied when this component is rendered Setter for style

Specified by:
setStyle in class UIFileUpload
Parameters:
style - - new value

getStyle

public java.lang.String getStyle()
CSS style(s) is/are to be applied when this component is rendered Getter for style

Specified by:
getStyle in class UIFileUpload
Returns:
style value from local variable or value bindings

setAccept

public void setAccept(java.lang.String __accept)
a comma-separated list of content types to accept, may not be supported by the browser. E.g. "images/png,images/jpg", "images/*". Setter for accept

Specified by:
setAccept in class UIFileUpload
Parameters:
accept - - new value

getAccept

public java.lang.String getAccept()
a comma-separated list of content types to accept, may not be supported by the browser. E.g. "images/png,images/jpg", "images/*". Getter for accept

Specified by:
getAccept in class UIFileUpload
Returns:
accept value from local variable or value bindings

setContentType

public void setContentType(java.lang.String __contentType)
the property to receive the contentType Setter for contentType

Parameters:
contentType - - new value

getContentType

public java.lang.String getContentType()
the property to receive the contentType Getter for contentType

Returns:
contentType value from local variable or value bindings

setFileName

public void setFileName(java.lang.String __fileName)
this value binding receives the filename (optional). Setter for fileName

Parameters:
fileName - - new value

getFileName

public java.lang.String getFileName()
this value binding receives the filename (optional). Getter for fileName

Returns:
fileName value from local variable or value bindings

setData

public void setData(java.lang.Object __data)
this value binding receives the file's content type (optional). Setter for data

Parameters:
data - - new value

getData

public java.lang.Object getData()
this value binding receives the file's content type (optional). Getter for data

Returns:
data value from local variable or value bindings

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIInput

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIInput

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIInput


Copyright © 2007. All Rights Reserved.