| org.araneaframework.uilib.form.GenericFormElement org.araneaframework.uilib.form.FormWidget
All known Subclasses: org.araneaframework.uilib.form.BeanFormWidget,
FormWidget | public class FormWidget extends GenericFormElement implements FormContext(Code) | | This class represents a form element that can contain other form elements.
author: Jevgeni Kabanov (ekabanov at araneaframework dot org) |
Field Summary | |
protected LinkedMap | elements |
Method Summary | |
public void | accept(String id, FormElementVisitor visitor) | public void | addElement(String id, GenericFormElement element) Adds a contained element. | public FormElement | addElement(String elementName, String labelId, Control control, Data data, boolean mandatory) This method adds a
FormElement to this
FormWidget . | public FormElement | addElement(String elementName, String labelId, Control control, Data data, Object initialValue, boolean mandatory) This method adds a
FormElement to this
FormWidget . | public void | addElementAfter(String id, GenericFormElement element, String afterId) Adds a contained element with given id after the element with specified id. | public void | addElementBefore(String id, GenericFormElement element, String beforeId) Adds a contained element with given id before the element with specified id. | public void | addError(String error) | public FormWidget | addSubForm(String id) Adds a new subform to this
FormWidget .
Parameters: id - subform id. | public void | clearErrors() | protected void | convertInternal() Calls
GenericFormElement.convert for all contained elements. | public FormElement | createElement(String labelId, Control control, Data data, Object initialValue, boolean mandatory) This method makes a
FormElement with given
Control and
Data . | public FormElement | createElement(String labelId, Control control, Data data, boolean mandatory) This method makes a
FormElement with given
Control and
Data .
Parameters: labelId - id of the localized label. Parameters: control - the type of control data. Parameters: data - the type of data. Parameters: mandatory - whether the element must be present in request. | protected Environment | getChildWidgetEnvironment() | public Control | getControlByFullName(String fullName) Returns composite form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. | public GenericFormElement | getElement(String elementName) Returns a contained element by its name. | public FormElement | getElementByFullName(String fullName) Returns simple form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. | public Map | getElements() Returns elements. | public GenericFormElement | getGenericElementByFullName(String fullName) Returns form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. | public FormWidget | getSubFormByFullName(String fullName) Returns simple form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. | public Object | getValueByFullName(String fullName) Returns form element value specified by full name.
Parameters: fullName - The full dot-separated name of the form element. | public Object | getViewModel() Returns
ViewModel . | protected void | init() | public boolean | isDisabled() | public boolean | isStateChanged() | public boolean | isValid() | public void | markBaseState() | public void | removeElement(String id) Removes a contained element by its name. | public void | restoreBaseState() | public void | setDisabled(boolean disabled) | public 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. |
elements | protected LinkedMap elements(Code) | | |
addElement | public void addElement(String id, GenericFormElement element)(Code) | | Adds a contained element.
Parameters: element - contained element. Parameters: id - element id |
addElement | public FormElement addElement(String elementName, String labelId, Control control, Data data, boolean mandatory)(Code) | | This method adds a
FormElement to this
FormWidget .
Parameters: elementName - the name of the form element. Parameters: labelId - id of the localized label. Parameters: control - the type of control data. Parameters: data - the type of data. Parameters: mandatory - whether the element must be present in request. |
addElement | public FormElement addElement(String elementName, String labelId, Control control, Data data, Object initialValue, boolean mandatory)(Code) | | This method adds a
FormElement to this
FormWidget .
Parameters: elementName - the name of the form element. Parameters: labelId - id of the localized label. Parameters: control - the type of control data. Parameters: data - the type of data. Parameters: mandatory - whether the element must be present in request. |
addElementAfter | public void addElementAfter(String id, GenericFormElement element, String afterId)(Code) | | Adds a contained element with given id after the element with specified id.
Parameters: id - added element id Parameters: element - added element Parameters: afterId - element id after which contained element should be added |
addElementBefore | public void addElementBefore(String id, GenericFormElement element, String beforeId)(Code) | | Adds a contained element with given id before the element with specified id.
Should be only used in RARE cases where internal order of elements matters for some reason.
Parameters: id - added element id Parameters: element - added element Parameters: beforeId - element id before which contained element should be added |
clearErrors | public void clearErrors()(Code) | | |
createElement | public FormElement createElement(String labelId, Control control, Data data, Object initialValue, boolean mandatory)(Code) | | This method makes a
FormElement with given
Control and
Data .
Parameters: labelId - localized label id Parameters: control - the type of control Parameters: data - the type of data Parameters: initialValue - initial value for data Parameters: mandatory - whether the element must be filled in FormElement with given configuration |
createElement | public FormElement createElement(String labelId, Control control, Data data, boolean mandatory)(Code) | | This method makes a
FormElement with given
Control and
Data .
Parameters: labelId - id of the localized label. Parameters: control - the type of control data. Parameters: data - the type of data. Parameters: mandatory - whether the element must be present in request. FormElement with given configuration |
getControlByFullName | public Control getControlByFullName(String fullName)(Code) | | Returns composite form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. composite form element specified by full name. |
getElement | public GenericFormElement getElement(String elementName)(Code) | | Returns a contained element by its name.
Parameters: elementName - contained element name a contained element by its name. |
getElementByFullName | public FormElement getElementByFullName(String fullName)(Code) | | Returns simple form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. simple form element specified by full name. |
getElements | public Map getElements()(Code) | | Returns elements.
elements. |
getGenericElementByFullName | public GenericFormElement getGenericElementByFullName(String fullName)(Code) | | Returns form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. form element specified by full name. |
getSubFormByFullName | public FormWidget getSubFormByFullName(String fullName)(Code) | | Returns simple form element specified by full name.
Parameters: fullName - The full dot-separated name of the form element. simple form element specified by full name. |
getValueByFullName | public Object getValueByFullName(String fullName)(Code) | | Returns form element value specified by full name.
Parameters: fullName - The full dot-separated name of the form element. form element value specified by full name. |
getViewModel | public Object getViewModel()(Code) | | Returns
ViewModel .
ViewModel. |
isDisabled | public boolean isDisabled()(Code) | | |
isStateChanged | public boolean isStateChanged()(Code) | | |
isValid | public boolean isValid()(Code) | | |
markBaseState | public void markBaseState()(Code) | | |
removeElement | public void removeElement(String id)(Code) | | Removes a contained element by its name.
|
restoreBaseState | public void restoreBaseState()(Code) | | |
setDisabled | public void setDisabled(boolean disabled)(Code) | | |
setValueByFullName | public void setValueByFullName(String fullName, Object value)(Code) | | Sets form element value specified by full name.
Parameters: fullName - The full dot-separated name of the form element. Parameters: value - form element value specified by full name. |
validateInternal | protected boolean validateInternal() throws Exception(Code) | | Controls that the constraints and all subcontrols are valid.
|
|
|