|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.core.BaseWidget
org.araneaframework.core.BaseApplicationWidget
org.araneaframework.uilib.form.GenericFormElement
org.araneaframework.uilib.form.FormWidget
public class FormWidget
This class represents a form element that can contain other form elements.
| Nested Class Summary | |
|---|---|
class |
FormWidget.ViewModel
Represents a composite form element view model. |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseApplicationWidget |
|---|
BaseApplicationWidget.CompositeImpl, BaseApplicationWidget.ViewableImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseWidget |
|---|
BaseWidget.WidgetImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseService |
|---|
BaseService.ServiceImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseComponent |
|---|
BaseComponent.ComponentImpl |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationWidget |
|---|
ApplicationWidget.WidgetViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationService |
|---|
ApplicationService.ServiceViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationComponent |
|---|
ApplicationComponent.ComponentViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.Composite |
|---|
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget |
| Nested classes/interfaces inherited from interface org.araneaframework.Viewable |
|---|
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget |
| Nested classes/interfaces inherited from interface org.araneaframework.Widget |
|---|
Widget.Interface |
| Field Summary | |
|---|---|
protected LinkedMap |
elements
|
| Fields inherited from class org.araneaframework.uilib.form.GenericFormElement |
|---|
backgroundValidation, constraint, converted, properties, SEAMLESS_VALIDATION_ACTION_ID, validated |
| Fields inherited from class org.araneaframework.core.BaseService |
|---|
currentInputData, currentOutputData |
| Fields inherited from interface org.araneaframework.core.ApplicationWidget |
|---|
EVENT_HANDLER_ID_KEY, EVENT_PARAMETER_KEY, EVENT_PATH_KEY |
| Fields inherited from interface org.araneaframework.core.ApplicationService |
|---|
ACTION_HANDLER_ID_KEY, ACTION_PARAMETER_KEY, ACTION_PATH_KEY |
| Constructor Summary | |
|---|---|
FormWidget()
|
|
| Method Summary | |
|---|---|
void |
accept(String id,
FormElementVisitor visitor)
Accepts the visitor. |
void |
addElement(String id,
GenericFormElement element)
Adds a contained element. |
FormElement |
addElement(String elementName,
String labelId,
Control control,
Data data,
boolean mandatory)
This method adds a FormElement to this FormWidget. |
FormElement |
addElement(String elementName,
String labelId,
Control control,
Data data,
Object initialValue,
boolean mandatory)
This method adds a FormElement to this FormWidget. |
void |
addElementAfter(String id,
GenericFormElement element,
String afterId)
Adds a contained element with given id after the element with specified id. |
void |
addElementBefore(String id,
GenericFormElement element,
String beforeId)
Adds a contained element with given id before the element with specified id. |
void |
addError(String error)
|
FormWidget |
addSubForm(String id)
Adds a new subform to this FormWidget. |
void |
clearErrors()
Clears element errors. |
protected void |
convertInternal()
Calls GenericFormElement.convert() for all contained elements. |
FormElement |
createElement(String labelId,
Control control,
Data data,
boolean mandatory)
This method makes a FormElement with given Control and Data. |
FormElement |
createElement(String labelId,
Control control,
Data data,
Object initialValue,
boolean mandatory)
This method makes a FormElement with given Control and Data. |
protected Environment |
getChildWidgetEnvironment()
Returns the widget's Environment by default. |
Control |
getControlByFullName(String fullName)
Returns composite form element specified by full name. |
GenericFormElement |
getElement(String elementName)
Returns a contained element by its name. |
FormElement |
getElementByFullName(String fullName)
Returns simple form element specified by full name. |
Map |
getElements()
Returns elements. |
GenericFormElement |
getGenericElementByFullName(String fullName)
Returns form element specified by full name. |
FormWidget |
getSubFormByFullName(String fullName)
Returns simple form element specified by full name. |
Object |
getValueByFullName(String fullName)
Returns form element value specified by full name. |
Object |
getViewModel()
Returns FormWidget.ViewModel. |
protected void |
init()
Init callback. |
boolean |
isDisabled()
Returns whether the element is disabled. |
boolean |
isStateChanged()
Returns whether data item state has changed after it was marked. |
boolean |
isValid()
Returns whether the element is valid. |
void |
markBaseState()
Marks the current value of the data item as the base state that will be used to determine whether its state has changed in GenericFormElement.isStateChanged(). |
void |
removeElement(String id)
Removes a contained element by its name. |
void |
restoreBaseState()
Restores the value of the data item from the marked base state. |
void |
setDisabled(boolean disabled)
Sets wether the element is disabled. |
void |
setValueByFullName(String fullName,
Object value)
Sets form element value specified by full name. |
protected boolean |
validateInternal()
Controls that the constraints and all subcontrols are valid. |
| Methods inherited from class org.araneaframework.uilib.form.GenericFormElement |
|---|
addErrors, convert, convertAndValidate, getConstraint, getConstraintEnvironment, getErrors, getMessageCtx, getMutableErrors, getProperties, getProperty, getValue, isBackgroundValidation, isEvaluated, setBackgroundValidation, setConstraint, setProperty, validate |
| Methods inherited from class org.araneaframework.core.BaseApplicationWidget |
|---|
_getComposite, _getViewable, action, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, disableWidget, enableWidget, event, getActionId, getChildEnvironment, getChildren, getEnvironment, getEventId, getWidget, handleAction, handleEvent, handleUpdate, propagate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, render, setGlobalEventListener, update |
| Methods inherited from class org.araneaframework.core.BaseWidget |
|---|
_getWidget, getInputData, getOutputData, handleWidgetException |
| Methods inherited from class org.araneaframework.core.BaseService |
|---|
_getService, handleServiceException |
| Methods inherited from class org.araneaframework.core.BaseComponent |
|---|
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, destroy, disable, enable, getScope, handleException, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.araneaframework.uilib.form.FormContext |
|---|
getProperties, isBackgroundValidation |
| Methods inherited from interface org.araneaframework.Widget |
|---|
_getWidget |
| Methods inherited from interface org.araneaframework.Service |
|---|
_getService |
| Methods inherited from interface org.araneaframework.Component |
|---|
_getComponent, getScope, isAlive |
| Field Detail |
|---|
protected LinkedMap elements
| Constructor Detail |
|---|
public FormWidget()
| Method Detail |
|---|
protected void init()
throws Exception
BaseComponent
init in class GenericFormElementException - Any runtime exception that may occur.
protected Environment getChildWidgetEnvironment()
throws Exception
BaseApplicationWidget
getChildWidgetEnvironment in class BaseApplicationWidgetExceptionpublic void clearErrors()
GenericFormElement
clearErrors in class GenericFormElementpublic boolean isValid()
GenericFormElement
isValid in class GenericFormElementpublic GenericFormElement getElement(String elementName)
elementName - contained element name
public void addElementAfter(String id,
GenericFormElement element,
String afterId)
id - added element idelement - added elementafterId - element id after which contained element should be added
public void addElementBefore(String id,
GenericFormElement element,
String beforeId)
id - added element idelement - added elementbeforeId - element id before which contained element should be added
public void addElement(String id,
GenericFormElement element)
element - contained element.id - element idpublic void removeElement(String id)
public Map getElements()
protected void convertInternal()
throws Exception
GenericFormElement.convert() for all contained elements.
convertInternal in class GenericFormElementException
protected boolean validateInternal()
throws Exception
validateInternal in class GenericFormElementExceptionpublic void markBaseState()
GenericFormElementGenericFormElement.isStateChanged().
markBaseState in class GenericFormElementpublic void restoreBaseState()
GenericFormElement
restoreBaseState in class GenericFormElementpublic boolean isStateChanged()
GenericFormElement
isStateChanged in class GenericFormElementpublic void setDisabled(boolean disabled)
GenericFormElement
setDisabled in class GenericFormElementdisabled - wether the element is disabled.public boolean isDisabled()
GenericFormElement
isDisabled in class GenericFormElement
public void accept(String id,
FormElementVisitor visitor)
GenericFormElement
accept in class GenericFormElementpublic FormWidget addSubForm(String id)
FormWidget.
id - subform id.
public FormElement createElement(String labelId,
Control control,
Data data,
Object initialValue,
boolean mandatory)
FormElement with given Control and Data.
labelId - localized label idcontrol - the type of controldata - the type of datainitialValue - initial value for datamandatory - whether the element must be filled in
FormElement with given configuration
public FormElement createElement(String labelId,
Control control,
Data data,
boolean mandatory)
FormElement with given Control and Data.
labelId - id of the localized label.control - the type of control data.data - the type of data.mandatory - whether the element must be present in request.
FormElement with given configuration
public FormElement addElement(String elementName,
String labelId,
Control control,
Data data,
boolean mandatory)
FormElement to this FormWidget.
elementName - the name of the form element.labelId - id of the localized label.control - the type of control data.data - the type of data.mandatory - whether the element must be present in request.
public FormElement addElement(String elementName,
String labelId,
Control control,
Data data,
Object initialValue,
boolean mandatory)
FormElement to this FormWidget.
elementName - the name of the form element.labelId - id of the localized label.control - the type of control data.data - the type of data.mandatory - whether the element must be present in request.public GenericFormElement getGenericElementByFullName(String fullName)
fullName - The full dot-separated name of the form element.
public FormElement getElementByFullName(String fullName)
fullName - The full dot-separated name of the form element.
public FormWidget getSubFormByFullName(String fullName)
fullName - The full dot-separated name of the form element.
public Control getControlByFullName(String fullName)
fullName - The full dot-separated name of the form element.
public Object getValueByFullName(String fullName)
fullName - The full dot-separated name of the form element.
public void setValueByFullName(String fullName,
Object value)
fullName - The full dot-separated name of the form element.value - form element value specified by full name.public void addError(String error)
addError in class GenericFormElementpublic Object getViewModel()
FormWidget.ViewModel.
getViewModel in class BaseApplicationWidgetFormWidget.ViewModel.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||