|
||||||||||
| 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.zkoss.jsf.zul.impl.AbstractComponent
org.zkoss.jsf.zul.impl.LeafComponent
org.zkoss.jsf.zul.impl.BranchComponent
org.zkoss.jsf.zul.impl.BranchOutput
org.zkoss.jsf.zul.impl.BranchInput
public abstract class BranchInput
The skeletal class used to implement the ZULJSF components which needs to
support EditableValueHolder.
Components
should be declared nested under Page.
see Javadoc of JSF
Specification
| Field Summary |
|---|
| Fields inherited from class org.zkoss.jsf.zul.impl.LeafComponent |
|---|
_compAttrMap, _composer |
| Fields inherited from class javax.faces.component.UIComponent |
|---|
bindings |
| Constructor Summary | |
|---|---|
BranchInput()
|
|
| Method Summary | |
|---|---|
protected void |
addErrorMessage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String messageId,
java.lang.Object[] parms)
|
void |
addValidator(javax.faces.validator.Validator validator)
|
void |
addValueChangeListener(javax.faces.event.ValueChangeListener listener)
|
protected void |
afterZULComponentComposed(org.zkoss.zk.ui.Component zulcomp)
Override Method, if instance implements ClientInputSupport
(for now, it is always ), then i will try to set the name/value which get from
ClientInputSupport into zulcomp. |
void |
broadcast(javax.faces.event.FacesEvent event)
|
protected void |
clientInputDecode(javax.faces.context.FacesContext context)
Decode value in request's parameter. call by decode(javax.faces.context.FacesContext) |
protected boolean |
compareValues(java.lang.Object previous,
java.lang.Object value)
|
void |
decode(javax.faces.context.FacesContext context)
|
protected java.lang.Object |
getConvertedValue(javax.faces.context.FacesContext context,
java.lang.Object submittedValue)
Convert the provided object to the desired value. |
java.lang.String |
getInputAttributeName()
Return ZUL Component attribute name which can handler the submition of input. |
java.lang.String |
getInputAttributeValue()
Return ZUL Component attribute value which can handler the submition of input. |
java.lang.Object |
getSubmittedValue()
|
javax.faces.el.MethodBinding |
getValidator()
|
javax.faces.validator.Validator[] |
getValidators()
|
javax.faces.el.MethodBinding |
getValueChangeListener()
|
javax.faces.event.ValueChangeListener[] |
getValueChangeListeners()
|
boolean |
isImmediate()
|
boolean |
isRequired()
|
boolean |
isValid()
|
void |
processDecodes(javax.faces.context.FacesContext context)
Set the "submitted value" of this component from the relevant data in the current servlet request object. |
void |
processUpdates(javax.faces.context.FacesContext context)
|
void |
processValidators(javax.faces.context.FacesContext context)
In addition to the standard processValidators behavior
inherited from UIComponentBase, calls
validate() if the immediate property is
false (which is the default); if the component is invalid afterwards,
calls FacesContext.renderResponse(). |
void |
removeValidator(javax.faces.validator.Validator validator)
|
void |
removeValueChangeListener(javax.faces.event.ValueChangeListener listener)
|
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
Override Method, restore the state of this component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
Override Method, save the state of this component. |
void |
setImmediate(boolean immediate)
|
void |
setRequired(boolean required)
|
void |
setSubmittedValue(java.lang.Object submittedValue)
|
void |
setValid(boolean valid)
|
void |
setValidator(javax.faces.el.MethodBinding validatorBinding)
|
void |
setValueChangeListener(javax.faces.el.MethodBinding valueChangeMethod)
|
void |
updateModel(javax.faces.context.FacesContext context)
|
void |
validate(javax.faces.context.FacesContext context)
Determine whether the new value is valid, and queue a ValueChangeEvent if necessary. |
protected void |
validateValue(javax.faces.context.FacesContext context,
java.lang.Object convertedValue)
|
| Methods inherited from class org.zkoss.jsf.zul.impl.BranchOutput |
|---|
getConverter, getLocalValue, getMappedAttributeName, getValue, isLocalValueSet, setConverter, setLocalValueSet, setValue, transferValueForAttribute |
| Methods inherited from class org.zkoss.jsf.zul.impl.BranchComponent |
|---|
loadZULTree |
| Methods inherited from class org.zkoss.jsf.zul.impl.LeafComponent |
|---|
addZULDynamicAttribute, encodeBegin, encodeChildren, encodeEnd, evaluateDynaAttributes, getAttributeValue, getComponentDefName, getComponentInfo, getForward, getRendersChildren, getUse, getZULComponent, setAttributeValue, setForward, setId, setUse, setZULDynamicAttribute |
| Methods inherited from class org.zkoss.jsf.zul.impl.AbstractComponent |
|---|
findAncestorWithClass, getBodyContent, getFacesContext, getFamily, getIf, getUnless, isEffective, isSuppressed, restoreAttachedMapState, saveAttachedMapState, setBodyContent, setIf, setSuppressed, setUnless |
| Methods inherited from class javax.faces.component.UIComponentBase |
|---|
addFacesListener, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, 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.EditableValueHolder |
|---|
isLocalValueSet, setLocalValueSet |
| Methods inherited from interface javax.faces.component.ValueHolder |
|---|
getConverter, getLocalValue, getValue, setConverter, setValue |
| Constructor Detail |
|---|
public BranchInput()
| Method Detail |
|---|
public java.lang.Object getSubmittedValue()
getSubmittedValue in interface javax.faces.component.EditableValueHolderpublic void setSubmittedValue(java.lang.Object submittedValue)
setSubmittedValue in interface javax.faces.component.EditableValueHolderpublic boolean isRequired()
isRequired in interface javax.faces.component.EditableValueHolderpublic boolean isValid()
isValid in interface javax.faces.component.EditableValueHolderpublic void setValid(boolean valid)
setValid in interface javax.faces.component.EditableValueHolderpublic void setRequired(boolean required)
setRequired in interface javax.faces.component.EditableValueHolderpublic boolean isImmediate()
isImmediate in interface javax.faces.component.EditableValueHolderpublic void setImmediate(boolean immediate)
setImmediate in interface javax.faces.component.EditableValueHolderpublic javax.faces.el.MethodBinding getValidator()
getValidator in interface javax.faces.component.EditableValueHolderpublic void setValidator(javax.faces.el.MethodBinding validatorBinding)
setValidator in interface javax.faces.component.EditableValueHolderpublic javax.faces.el.MethodBinding getValueChangeListener()
getValueChangeListener in interface javax.faces.component.EditableValueHolderpublic void setValueChangeListener(javax.faces.el.MethodBinding valueChangeMethod)
setValueChangeListener in interface javax.faces.component.EditableValueHolderpublic void processDecodes(javax.faces.context.FacesContext context)
If this component is not rendered, then do nothing; no output would have been sent to the client so no input is expected.
Invoke the inherited functionality, which typically invokes the renderer associated with this component to extract and set this component's "submitted value".
If this component is marked "immediate", then immediately apply validation to the submitted value found. On error, call context method "renderResponse" which will force processing to leap to the "render response" phase as soon as the "decode" step has completed for all other components.
processDecodes in class javax.faces.component.UIComponentBasepublic void processValidators(javax.faces.context.FacesContext context)
In addition to the standard processValidators behavior
inherited from UIComponentBase, calls
validate() if the immediate property is
false (which is the default); if the component is invalid afterwards,
calls FacesContext.renderResponse(). If a
RuntimeException is thrown during validation processing,
calls FacesContext.renderResponse() and
re-throw the exception.
processValidators in class javax.faces.component.UIComponentBasejava.lang.NullPointerExceptionpublic void processUpdates(javax.faces.context.FacesContext context)
processUpdates in class javax.faces.component.UIComponentBasepublic void decode(javax.faces.context.FacesContext context)
decode in class javax.faces.component.UIComponentBasejava.lang.NullPointerException
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
broadcast in class javax.faces.component.UIComponentBasejavax.faces.event.AbortProcessingExceptionpublic void updateModel(javax.faces.context.FacesContext context)
protected void validateValue(javax.faces.context.FacesContext context,
java.lang.Object convertedValue)
public void validate(javax.faces.context.FacesContext context)
The "submitted value" is converted to the necessary type; conversion failure is reported as an error and validation processing terminates for this component. See documentation for method getConvertedValue for details on the conversion process.
Any validators attached to this component are then run, passing the converted value.
The old value of this component is then fetched (possibly involving the evaluation of a value-binding expression, ie invoking a method on a user object). The old value is compared to the new validated value, and if they are different then a ValueChangeEvent is queued for later processing.
On successful completion of this method:
protected java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
java.lang.Object submittedValue)
If there is a renderer for this component, then call the renderer's getConvertedValue method. While this can of course be implemented in any way the renderer desires, it typically performs exactly the same processing that this method would have done anyway (ie that described below for the no-renderer case).
Otherwise:
protected boolean compareValues(java.lang.Object previous,
java.lang.Object value)
public void addValidator(javax.faces.validator.Validator validator)
addValidator in interface javax.faces.component.EditableValueHolderpublic javax.faces.validator.Validator[] getValidators()
getValidators in interface javax.faces.component.EditableValueHolderpublic void removeValidator(javax.faces.validator.Validator validator)
removeValidator in interface javax.faces.component.EditableValueHolderpublic void addValueChangeListener(javax.faces.event.ValueChangeListener listener)
addValueChangeListener in interface javax.faces.component.EditableValueHolderpublic javax.faces.event.ValueChangeListener[] getValueChangeListeners()
getValueChangeListeners in interface javax.faces.component.EditableValueHolderpublic void removeValueChangeListener(javax.faces.event.ValueChangeListener listener)
removeValueChangeListener in interface javax.faces.component.EditableValueHolderpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class BranchOutput
public void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class BranchOutputprotected void afterZULComponentComposed(org.zkoss.zk.ui.Component zulcomp)
ClientInputSupport
(for now, it is always ), then i will try to set the name/value which get from
ClientInputSupport into zulcomp. For Example of TextboxComponent, a
name=form:compid will set to zulcomp and the result in HTML will likes
(<input id="z_fm_2c" type="text"
name="helloForm:txt1" value="0"
z.type="zul.widget.Txbox"/> ). And then , after form submit,
I can decode the submitted value from request by name "helloForm:txt1".
afterZULComponentComposed in class BranchOutputpublic java.lang.String getInputAttributeName()
getInputAttributeName in interface ClientInputSupportClientInputSupportpublic java.lang.String getInputAttributeValue()
getInputAttributeValue in interface ClientInputSupportClientInputSupport,
UIComponent.getClientId(FacesContext)protected void clientInputDecode(javax.faces.context.FacesContext context)
decode(javax.faces.context.FacesContext)
protected void addErrorMessage(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String messageId,
java.lang.Object[] parms)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||