|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaConfig
public class DynaConfig
Overrule the way DynaForm presents a specific persistent attribute.
The DynaForm uses a pluggable Extractor to analyse a particular class and determine what persistent properties it has, and how to render them. By default the dynaform will create a JSF component for each one of the detected persistent properties, using the detected metadata.
Any number of instances of this component can be added as children to a DynaForm component to override the settings auto-detected by the Extractor. Each instance overrides the properties of a single persistent field. The attribute "for" on this component should specify the name of the property to be overridden on the persistent object associated with the DynaForm.
This component can also have a single child component, in which case that is used as the component for rendering this dynamic field.
| Field Summary | |
|---|---|
static String |
COMPONENT_FAMILY
|
static String |
COMPONENT_TYPE
|
| Constructor Summary | |
|---|---|
DynaConfig()
|
|
| Method Summary | |
|---|---|
void |
configureMetaData(MetaFieldWritable field)
Update the specified field with the settings the user has configured from this JSF component. |
Object |
getComponentHandler()
Specifies the "controller bean" used to render this specific field. |
Boolean |
getDisabled()
|
Boolean |
getDisplayOnly()
|
Integer |
getDisplaySize()
|
String |
getFamily()
|
String |
getFor()
|
Boolean |
getReadOnly()
|
void |
restoreState(javax.faces.context.FacesContext context,
Object stateArray)
|
Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setComponentHandler(Object value)
Specifies the "controller bean" used to render this specific field. |
void |
setDisabled(Boolean disabled)
configure this field as disabled - like readOnly but grayed too |
void |
setDisplayOnly(Boolean displayOnly)
set the field to display only |
void |
setDisplaySize(Integer displaySize)
a hint for the size the ui should use when rendering the field |
void |
setFor(String forProperty)
the name of the property this configuration is for |
void |
setReadOnly(Boolean readOnly)
configure this field as readOnly - noneditable input field |
| 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, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, 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 |
|---|
public static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
| Constructor Detail |
|---|
public DynaConfig()
| Method Detail |
|---|
public String getFamily()
getFamily in class javax.faces.component.UIComponentpublic Integer getDisplaySize()
setDisplaySize(Integer)public void setDisplaySize(Integer displaySize)
public Boolean getDisplayOnly()
setDisplayOnly(Boolean)public void setDisplayOnly(Boolean displayOnly)
public Boolean getReadOnly()
setReadOnly(Boolean)public void setReadOnly(Boolean readOnly)
public Boolean getDisabled()
setDisabled(Boolean)public void setDisabled(Boolean disabled)
public Object getComponentHandler()
This may return:
The configureMetaData method of this class just copies this setting into a MetaField object which is later used when building the components necessary to manage this field.
When the value is null, dynaform will create a default component to manage this field, depending on its type.
In the other cases, the DynaFormComponentHandler object is responsible for creating the necessary UI components to manage this field.
Normally, the JSP/Facelets framework will set this property to a String when the user provides a non-EL-expression, and will put a ValueBinding object into this component's value-binding map when the user provides an EL expression. As the value-binding could return a DynaFormComponentHandler or a String, this property type must be Object.
public void setComponentHandler(Object value)
This should be the name of a managed bean which implements DynaFormComponentHandler, or an actual DynaFormComponentHandler instance.
public String getFor()
setFor(String)public void setFor(String forProperty)
public void restoreState(javax.faces.context.FacesContext context,
Object stateArray)
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIComponentBasepublic Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIComponentBasepublic void configureMetaData(MetaFieldWritable field)
This method is called after the user-specified extractor implementation is called. This means that any settings the user has defined in the JSF can override those auto-detected via the earlier extractor. However here we must only override earlier settings if they really have been set in the JSF config.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||