Class BaseField
java.lang.Object
com.axemble.vdp.ui.framework.foundation.Component
com.axemble.vdp.ui.framework.foundation.Widget
com.axemble.vdp.ui.framework.widgets.CtlInputWidget
com.axemble.vdoc.sdk.document.fields.base.BaseField
- All Implemented Interfaces:
IWidget,IWritable,com.axemble.vdp.ui.core.document.fields.IFieldControl,com.axemble.vdp.utils.parameters.ParamsHandler,Serializable
- Direct Known Subclasses:
BaseWorkflowField,LocalizedTextField,PeriodSelectionRangeDatePickerField,SelectionRangeDatePickerField,UrlSelectorField
public abstract class BaseField
extends com.axemble.vdp.ui.framework.widgets.CtlInputWidget
implements com.axemble.vdp.ui.core.document.fields.IFieldControl
This base class provides direct access to the SDK API.
- Version:
- 1.0, 15/04/2008
- Author:
- vlygeros
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.axemble.vdp.ui.core.document.fields.common.FieldAggregateFields inherited from class com.axemble.vdp.ui.framework.widgets.CtlInputWidget
accessKey, includeErrorInfo, mandatory, quickCreateLink, stringRecipient, tabIndex, throwDocumentChangedScript, throwEvents, throwEventsDefined, validationRulesFields inherited from class com.axemble.vdp.ui.framework.foundation.Widget
actionListeners, isHidden, param, parentBlock, sysname, userIdFields inherited from class com.axemble.vdp.ui.framework.foundation.Component
changeListeners, LOGGERFields inherited from interface com.axemble.vdp.utils.parameters.ParamsHandler
ERROR_EXCEED_ELEM_SIZE, ERROR_EXCEED_TOTAL_SIZE, ERROR_NOT_COMPLETED, ERROR_READ_FAILED, EXCEED_ELEM_NUMBER, NO_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanThis method checks if any error has been found.com.axemble.vdp.ui.framework.document.fields.IAbstractFieldcom.axemble.vdp.ui.core.document.fields.ICoreFieldgetField()com.axemble.vdp.ui.framework.components.listeners.ChangeListenerprotected final StringgetTemplateAsString(String relativePath) protected final com.axemble.vdp.ui.framework.template.TemplateWritergetTemplateWriter(String relativePath) This method loads a template writer object from a HTML template file.protected final ObjectgetValue()Allow to retrieve a value from the internal field objectfinal voidfinal voidinit(com.axemble.vdp.ui.framework.document.fields.IAbstractField field, Element element, boolean editable, boolean mandatory) voidThis method is called once when the document is loadedfinal IWritableIf an error has been found, this method writes the message in a standard wayprotected final voidAllow to set a value to the internal field objectabstract voidabstract voidMethods inherited from class com.axemble.vdp.ui.framework.widgets.CtlInputWidget
addRefreshButton, addValidationRule, buildFieldElement, canThrowEventsInWebBrowser, clearValidationRules, findStringRecipient, focus, getAccessKey, getAssociatedLabel, getDescription, getDocumentChangedScript, getErrorInfo, getHelpMessageIcon, getParentId, getQuickCreateLink, getRefreshButton, getTabIndex, getValidationObject, getValidationRules, handleNoParams, handleParams, handleParams, hasValidationRules, inform, isDescription, isDocumentChangedScript, isEditable, isEmpty, isFocus, isForceParentId, isIncludeErrorInfo, isMandatory, isThrowDocumentChangedScript, isThrowEventsDefined, renderErrorInfo, renderInfoMessage, renderQuickCreate, setAccessKey, setAssociatedLabel, setDescription, setEditable, setErrorInfo, setIncludeErrorInfo, setMandatory, setQuickCreateContextParameter, setQuickCreateScreen, setTabIndex, setThrowDocumentChangedScript, setThrowEvents, setThrowEventsDefined, setValidationRules, validateMethods inherited from class com.axemble.vdp.ui.framework.foundation.Widget
addActionListener, afterInit, buildFireMessage, buildFireMessage, buildFireMessage, buildFireMessage, buildFireMessage, buildFireMessage, buildFireOnClickMessage, buildFireOnClickMessage, buildFormName, findFileRecipient, findXmlRecipient, fireActionEvent, getCtrlTemplate, getCtrlTemplateWriter, getJavaScriptFocusScript, getJavascriptId, getParam, getParentBlock, getSysname, getUserDisplayName, getUserId, handleAction, hasActionListeners, isHidden, refresh, refreshWidgets, removeActionListener, removeActionListeners, render, renderMobile, setHidden, setParam, setParentBlock, setSysname, setUserId, writeMethods inherited from class com.axemble.vdp.ui.framework.foundation.Component
addChangeListener, createComponent, evaluateExpressions, fireChangeEvent, getDynamicDescription, getDynamicLabel, getLanguage, getNavigator, getRootNavigator, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, hasChangeListeners, removeChangeListener, removeChangeListeners, stateChangedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axemble.vdp.ui.core.document.fields.IFieldControl
addValidationRule, clearValidationRules, getUserId, getValidationRules, hasValidationRules, inform, isEditable, isHidden, isMandatory, setEditable, setHidden, setMandatory, setUserId, validate
-
Field Details
-
aggregate
protected com.axemble.vdp.ui.core.document.fields.common.FieldAggregate aggregate
-
-
Constructor Details
-
BaseField
public BaseField()
-
-
Method Details
-
getAbstractField
public com.axemble.vdp.ui.framework.document.fields.IAbstractField getAbstractField()- Specified by:
getAbstractFieldin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
getField
public com.axemble.vdp.ui.core.document.fields.ICoreField getField()- Specified by:
getFieldin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
getFieldChangeListener
public com.axemble.vdp.ui.framework.components.listeners.ChangeListener getFieldChangeListener()- Specified by:
getFieldChangeListenerin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
init
public final void init(com.axemble.vdp.ui.framework.document.fields.IAbstractField field, Element element) - Specified by:
initin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
init
public final void init(com.axemble.vdp.ui.framework.document.fields.IAbstractField field, Element element, boolean editable, boolean mandatory) - Specified by:
initin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
init
This method is called once when the document is loaded- Overrides:
initin classcom.axemble.vdp.ui.framework.widgets.CtlInputWidget- Parameters:
element- The W3C Element object which defines the field
-
updateControl
public abstract void updateControl()- Specified by:
updateControlin interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
updateValue
public abstract void updateValue()- Specified by:
updateValuein interfacecom.axemble.vdp.ui.core.document.fields.IFieldControl
-
getTemplateWriter
protected final com.axemble.vdp.ui.framework.template.TemplateWriter getTemplateWriter(String relativePath) throws RenderException This method loads a template writer object from a HTML template file. The relative path implies all the custom controls are in ".../storage/custom/controls/" directory.- Parameters:
relativePath-- Returns:
- a TemplateWriter object
- Throws:
RenderException- Here is an example on how to use this method: TemplateWriter tw = null; if ( this.isEditable() ) { tw = this.getTemplateWriter( "CtlTextBox.edit.html" ); tw.setEntry( "id", new TemplateToken( this.getNavigator().registerWidget( this ) ) ); tw.setEntry( "label", new TemplateToken( HTMLUtils.getHTMLAttrString( this.label ) ) ); if ( checkErrorMessage() ) tw.setEntry( "error-message", this.renderErrorMessage() ); } else { tw = this.getTemplateWriter( "CtlTextBox.read.html" ); tw.setEntry( "label", new TemplateToken( HTMLUtils.getHTMLString( this.label ) ) ); }
-
getTemplateAsString
- Throws:
RenderException
-
checkErrorMessage
protected final boolean checkErrorMessage()This method checks if any error has been found.- Returns:
- true if an error was added, false otherwise.
-
setValue
Allow to set a value to the internal field object- Parameters:
value- The value to set
-
getValue
Allow to retrieve a value from the internal field object- Returns:
- The value object
-
renderErrorMessage
If an error has been found, this method writes the message in a standard way- Returns:
- IWritable object
- Throws:
RenderException- Example: $error-message$ tag has to be in the HTML template, otherwise nothing will be shown. if ( checkErrorMessage() ) tw.setEntry( "error-message", this.renderErrorMessage() );
-