Package org.apache.empire.jsf2.utils
Class TagEncodingHelper
java.lang.Object
org.apache.empire.jsf2.utils.TagEncodingHelper
- All Implemented Interfaces:
javax.faces.component.NamingContainer
TagEncodingHelper
Used by all Empire Components to exchange data and render
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classColumnExprWrapper wraps a ColumnExpr object into a Column interface objectprotected classInputInfoImpl Provides information necessary to render an input control (editable)protected classValueInfoImpl Provides information necessary to render a data value (non editable) -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]protected static final Stringstatic final Stringstatic final Stringprotected Columnprotected final javax.faces.component.UIOutputstatic final Stringprotected InputControlstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic booleanprotected final Stringstatic final Stringprotected FormGridTagprotected byteprotected byteprotected Objectprotected Optionsprotected booleanstatic final Stringstatic final charstatic final charstatic final charprotected byteprotected Objectprotected RecordTagprotected booleanprotected static Stringprotected TextResolverprotected javax.faces.component.UIDataprotected InputControl.ValueInfoprotected byteFields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTagEncodingHelper(javax.faces.component.UIOutput component, String cssStyleClass) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFieldValueErrorMessage(javax.faces.context.FacesContext context, Exception e, Object value) protected voidaddRequiredMark(javax.faces.component.html.HtmlOutputLabel label) booleanbeginUpdateModel(javax.faces.context.FacesContext ctx, Object value) booleanbeginValidateValue(javax.faces.context.FacesContext ctx, Object value) static Stringprotected voidprotected StringcompleteLabelStyleClass(String styleClasses, boolean required) protected ColumncreateColumnExprWrapper(ColumnExpr colExpr) javax.faces.component.html.HtmlOutputLabelcreateLabelComponent(javax.faces.context.FacesContext context, String forInput, StyleClass styleClass, String style, boolean colon) protected booleandetectError(javax.faces.context.FacesContext context) protected InputControldetectInputControl(String controlType, DataType dataType) protected booleanprotected booleanprotected Optionsprotected booleanvoidCalled from UIComponent.encodeBegin()protected Columnprotected ColumnChecks whether the value attribute contains a column reference and returns itprotected Objectprotected javax.el.ValueExpressionfindTopValueExpression(String attribute) protected ObjectgetBeanPropertyValue(Object bean, String property) getColumnAttribute(String name) protected StringgetDataTypeClass(DataType type) Deprecated.getDataValue(boolean evalExpression) final StringgetDisplayText(Object value) getDisplayText(Column column, Object value) javax.faces.application.FacesMessagegetFieldValueErrorMessage(javax.faces.context.FacesContext context, Exception e, Object value) protected FormGridTaggetInputInfo(javax.faces.context.FacesContext ctx) getLabelTooltip(Column column) protected StringgetLabelValue(Column column, boolean colon) getSimpleStyleClass(String userStyle) getTagAttributeString(String name) getTagAttributeString(String name, String defValue) getTagAttributeStringEx(String name, boolean isCssStyleClass) getTagAttributeValue(String name) getTagAttributeValueEx(String name, boolean isCssStyleClass) getTagStyleClass(String typeClass) getTagStyleClass(String typeClass, String userStyle) getTextResolver(javax.faces.context.FacesContext context) protected javax.el.ValueExpressiongetValueInfo(javax.faces.context.FacesContext ctx) protected final OptionsgetValueTooltip(Object value) booleanbooleanstatic booleanhasComponentId(javax.faces.component.UIComponent component) booleanbooleanhasFormat(InputControl.ValueInfo vi, String format) protected booleanprotected booleanReturns whether a control element is rendered Use to detect legacy behavior with no separate control element and only two <td> for label and input wrapperprotected booleanfinal booleanfinal booleanfinal booleanbooleanbooleanbooleanbooleanfinal booleanbooleanvoidPrepares the control for decoding, validating and updatingvoidreset()voidvoidresetComponentId(javax.faces.component.UIComponent comp) voidrestoreComponentId(javax.faces.component.UIComponent comp) voidsaveComponentId(javax.faces.component.UIComponent comp) protected voidsetBeanPropertyValue(Object bean, String property, Object value) voidvoidsetDataValue(Object value) voidprotected ColumnunwrapColumn(Column col) protected ColumnExprunwrapColumnExpr(Column col) voidupdateLabelComponent(javax.faces.context.FacesContext context, javax.faces.component.html.HtmlOutputLabel label, String forInput) booleanvoidwriteAttribute(javax.faces.context.ResponseWriter writer, String attribute, Object value) voidwriteComponentId(javax.faces.context.ResponseWriter writer) voidwriteComponentId(javax.faces.context.ResponseWriter writer, boolean renderAutoId) voidwriteStyleClass(javax.faces.context.ResponseWriter writer) voidwriteStyleClass(javax.faces.context.ResponseWriter writer, String... styleClasses) writeWrapperTag(javax.faces.context.FacesContext context, boolean renderId, boolean renderValue) Writes a wrapper tag for e:value and e:input Hint: For e:control the input separator tag acts as the wrapper
-
Field Details
-
COMPONENT_FAMILY
- See Also:
-
FACES_ID_PREFIX
- See Also:
-
CSS_STYLE_USE_INPUT_TYPE_INSTEAD_OF_DATA_TYPE
public static boolean CSS_STYLE_USE_INPUT_TYPE_INSTEAD_OF_DATA_TYPE -
ORIGINAL_COMPONENT_ID
- See Also:
-
COLATTR_TOOLTIP
- See Also:
-
COLATTR_ABBR_TITLE
- See Also:
-
component
protected final javax.faces.component.UIOutput component -
cssStyleClass
-
column
-
record
-
recordTag
-
uiDataTag
protected javax.faces.component.UIData uiDataTag -
formGridTag
-
control
-
textResolver
-
hasValueExpr
protected byte hasValueExpr -
insideUIData
protected byte insideUIData -
readOnly
protected byte readOnly -
valueRequired
protected byte valueRequired -
optionsDetected
protected boolean optionsDetected -
options
-
valueInfo
-
skipValidation
protected boolean skipValidation -
mostRecentValue
-
PH_COLUMN_NAME
public static final char PH_COLUMN_NAME- See Also:
-
PH_COLUMN_FULL
public static final char PH_COLUMN_FULL- See Also:
-
PH_COLUMN_SMART
public static final char PH_COLUMN_SMART- See Also:
-
ALLOWED_COLUMN_PH
public static final char[] ALLOWED_COLUMN_PH -
SMART_COLUMN_NAME_SET
-
CC_ATTR_EXPR
- See Also:
-
TAGLIB_ATTR_PREFIX
-
CSS_DATA_TYPE_NONE
-
CSS_DATA_TYPE_INT
- See Also:
-
CSS_DATA_TYPE_NUMBER
- See Also:
-
CSS_DATA_TYPE_TEXT
- See Also:
-
CSS_DATA_TYPE_LONGTEXT
- See Also:
-
CSS_DATA_TYPE_DATE
- See Also:
-
CSS_DATA_TYPE_DATETIME
- See Also:
-
CSS_DATA_TYPE_BOOL
- See Also:
-
-
Constructor Details
-
TagEncodingHelper
Constructor- Parameters:
component- the UIComponentcssStyleClass- the basic cssStyleClass
-
-
Method Details
-
encodeBegin
public void encodeBegin()Called from UIComponent.encodeBegin() -
prepareData
public void prepareData()Prepares the control for decoding, validating and updating -
completeInputTagId
-
getInputControl
-
detectInputControl
-
checkRecord
protected void checkRecord() -
getValueInfo
-
getInputInfo
-
isSkipValidation
public boolean isSkipValidation() -
hasColumn
public boolean hasColumn() -
getColumn
-
getColumnName
-
getColumnFullName
-
getColumnSmartName
-
setColumn
-
getRecord
-
setRecord
-
reset
public void reset() -
resetColumn
public void resetColumn() -
findRecordComponent
-
isDetectFieldChange
protected boolean isDetectFieldChange() -
getDataValue
-
setDataValue
-
isRenderValueComponent
public boolean isRenderValueComponent() -
isRecordReadOnly
public boolean isRecordReadOnly() -
getRecordReadOnly
-
isVisible
public boolean isVisible() -
isReadOnly
public final boolean isReadOnly() -
detectReadOnly
protected boolean detectReadOnly() -
isValueRequired
public final boolean isValueRequired() -
detectValueRequired
protected boolean detectValueRequired() -
isDisabled
public final boolean isDisabled() -
getDisabled
-
isValueModified
public boolean isValueModified() -
validateNullValue
public boolean validateNullValue() -
beginValidateValue
-
beginUpdateModel
-
findColumn
-
findColumnFromValue
Checks whether the value attribute contains a column reference and returns it- Returns:
- the column
-
createColumnExprWrapper
-
unwrapColumnExpr
-
unwrapColumn
-
findRecord
-
getValueExpression
protected javax.el.ValueExpression getValueExpression() -
hasValueExpression
protected boolean hasValueExpression() -
findTopValueExpression
-
getBeanPropertyValue
-
setBeanPropertyValue
-
getValueOptions
-
detectValueOptions
-
getValueTooltip
-
getLabelTooltip
-
hasFormat
-
hasFormat
-
getDisplayText
-
getDisplayText
-
getTextResolver
-
getLocale
-
detectError
protected boolean detectError(javax.faces.context.FacesContext context) -
getFieldValueErrorMessage
-
addFieldValueErrorMessage
-
getFormGrid
-
getControlRenderInfo
-
getAutoControlId
-
getControlExtraLabelWrapperStyle
-
getControlExtraInputWrapperStyle
-
isControlTagElementValid
protected boolean isControlTagElementValid()Returns whether a control element is rendered Use to detect legacy behavior with no separate control element and only two <td> for label and input wrapper- Returns:
- true if a control element is rendered or false in legacy case
-
getLabelValue
-
createLabelComponent
public javax.faces.component.html.HtmlOutputLabel createLabelComponent(javax.faces.context.FacesContext context, String forInput, StyleClass styleClass, String style, boolean colon) -
updateLabelComponent
public void updateLabelComponent(javax.faces.context.FacesContext context, javax.faces.component.html.HtmlOutputLabel label, String forInput) -
completeLabelStyleClass
-
addRequiredMark
protected void addRequiredMark(javax.faces.component.html.HtmlOutputLabel label) -
getDataTypeClass
Deprecated. -
getSimpleStyleClass
-
getSimpleStyleClass
-
getTagStyleClass
-
getTagStyleClass
-
getTagStyleClass
-
getContextStyleClass
-
detectInsideUIData
protected boolean detectInsideUIData() -
isInsideUIData
public final boolean isInsideUIData() -
buildComponentId
-
hasComponentId
public static boolean hasComponentId(javax.faces.component.UIComponent component) -
hasComponentId
public boolean hasComponentId() -
saveComponentId
public void saveComponentId(javax.faces.component.UIComponent comp) -
restoreComponentId
public void restoreComponentId(javax.faces.component.UIComponent comp) -
resetComponentId
public void resetComponentId(javax.faces.component.UIComponent comp) -
getColumnAttribute
-
getColumnAttributeString
-
getTagAttributeValue
-
getTagAttributeString
-
getTagAttributeString
-
getTagAttributeValueEx
-
getTagAttributeStringEx
-
writeComponentId
public void writeComponentId(javax.faces.context.ResponseWriter writer, boolean renderAutoId) throws IOException - Throws:
IOException
-
writeComponentId
- Throws:
IOException
-
writeAttribute
public void writeAttribute(javax.faces.context.ResponseWriter writer, String attribute, Object value) throws IOException - Throws:
IOException
-
writeStyleClass
public void writeStyleClass(javax.faces.context.ResponseWriter writer, String... styleClasses) throws IOException - Throws:
IOException
-
writeStyleClass
- Throws:
IOException
-
writeWrapperTag
public String writeWrapperTag(javax.faces.context.FacesContext context, boolean renderId, boolean renderValue) throws IOException Writes a wrapper tag for e:value and e:input Hint: For e:control the input separator tag acts as the wrapper- Parameters:
context- the faces contextrenderId- flag whether or not to render the components client idrenderValue- flag whether to render and input wrapper (false) or a value wrapper (true)- Returns:
- the tag name of the wrapper tag
- Throws:
IOException- from ResponseWriter
-