com.sun.rave.web.ui.component
Class Upload

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended bycom.sun.rave.web.ui.component.HiddenFieldBase
                      extended bycom.sun.rave.web.ui.component.HiddenField
                          extended bycom.sun.rave.web.ui.component.FieldBase
                              extended bycom.sun.rave.web.ui.component.Field
                                  extended bycom.sun.rave.web.ui.component.UploadBase
                                      extended bycom.sun.rave.web.ui.component.Upload
All Implemented Interfaces:
ComplexComponent, javax.faces.component.EditableValueHolder, java.io.Serializable, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class Upload
extends UploadBase
implements java.io.Serializable

Use this component to allow web application users to upload a file. If a web application uses this component, it must be configured to use UploadFilter

Author:
avk
See Also:
Serialized Form

Field Summary
static java.lang.String INPUT_ID
          A string concatenated with the component ID to form the ID and name of the HTML input element.
static java.lang.String INPUT_PARAM_ID
           
static java.lang.String SCRIPT_FACET
           
static java.lang.String SCRIPT_ID
           
static java.lang.String TEXT_ID
           
 
Fields inherited from class com.sun.rave.web.ui.component.Field
LABEL_FACET, LABEL_ID, READONLY_FACET, READONLY_ID
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
Upload()
          Creates a new instance of Upload
 
Method Summary
 int getColumns()
          Number of character columns used to render this field.
 java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, java.lang.Object value)
          Converts the submitted value.
 java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
          Retrieves the DOM ID for the HTML input element.
 java.lang.Object getText()
          This method overrides getText() in Field.
 java.lang.String getType()
          Overrides getType in the FileInput class, to always return "file"
 java.lang.String getValueAsString(javax.faces.context.FacesContext context)
          Return the value to be rendered, as a String (converted if necessary), or null if the value is null.
protected  void log(java.lang.String s)
          Log an error - only used during development time.
 void setText(java.lang.Object text)
          This method overrides setText() in Field.
 
Methods inherited from class com.sun.rave.web.ui.component.UploadBase
getFamily, getUploadedFile, getValueBinding, restoreState, saveState, setColumns, setUploadedFile, setValueBinding
 
Methods inherited from class com.sun.rave.web.ui.component.Field
getLabelComponent, getReadOnlyComponent
 
Methods inherited from class com.sun.rave.web.ui.component.FieldBase
getLabel, getLabelLevel, getMaxLength, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyle, getStyleClass, getTabIndex, getToolTip, isDisabled, isReadOnly, isTrim, isVisible, setDisabled, setLabel, setLabelLevel, setMaxLength, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setToolTip, setTrim, setVisible
 
Methods inherited from class com.sun.rave.web.ui.component.HiddenField
getReadOnlyValueString
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, 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, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
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

INPUT_ID

public static final java.lang.String INPUT_ID
A string concatenated with the component ID to form the ID and name of the HTML input element.

See Also:
Constant Field Values

INPUT_PARAM_ID

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

SCRIPT_ID

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

SCRIPT_FACET

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

TEXT_ID

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

Upload

public Upload()
Creates a new instance of Upload

Method Detail

log

protected void log(java.lang.String s)
Log an error - only used during development time.

Overrides:
log in class Field

getConvertedValue

public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
                                          java.lang.Object value)

Converts the submitted value. Returns an object of type UploadedFile.

Overrides:
getConvertedValue in class HiddenField
Parameters:
context - The FacesContext
value - An object representing the submitted value
Returns:
An Object representation of the value (a java.lang.String or a java.io.File, depending on how the component is configured

getValueAsString

public java.lang.String getValueAsString(javax.faces.context.FacesContext context)

Return the value to be rendered, as a String (converted if necessary), or null if the value is null.

Overrides:
getValueAsString in class HiddenField
Parameters:
context - FacesContext for the current request
Returns:
A String value of the component

getType

public java.lang.String getType()
Overrides getType in the FileInput class, to always return "file"

Returns:
"file"

getText

public java.lang.Object getText()
This method overrides getText() in Field. It always returns null.

Overrides:
getText in class FieldBase

setText

public void setText(java.lang.Object text)
This method overrides setText() in Field. It is a noop.

Overrides:
setText in class Field

getColumns

public int getColumns()
Description copied from class: UploadBase

Number of character columns used to render this field.

Overrides:
getColumns in class UploadBase

getPrimaryElementID

public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
Retrieves the DOM ID for the HTML input element. To be used by Label component as a value for the "for" attribute.

Specified by:
getPrimaryElementID in interface ComplexComponent
Overrides:
getPrimaryElementID in class Field