Package org.apache.ofbiz.widget.model
Class ModelForm
- java.lang.Object
-
- org.apache.ofbiz.widget.model.ModelWidget
-
- org.apache.ofbiz.widget.model.ModelForm
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ModelGrid
,ModelSingleForm
public abstract class ModelForm extends ModelWidget
Abstract base class for the <form> and <grid> elements.- See Also:
widget-form.xsd
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModelForm.AltRowStyle
static class
ModelForm.AltTarget
static class
ModelForm.AutoFieldsEntity
static class
ModelForm.AutoFieldsService
static class
ModelForm.Banner
static class
ModelForm.FieldGroup
static interface
ModelForm.FieldGroupBase
static class
ModelForm.SortField
static class
ModelForm.UpdateArea
The UpdateArea class implements the<on-event-update-area>
elements used in form widgets.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FORM_RESULT_LIST_NAME
static java.lang.String
DEFAULT_PAG_FIRST_STYLE
static java.lang.String
DEFAULT_PAG_INDEX_FIELD
static java.lang.String
DEFAULT_PAG_LAST_STYLE
static java.lang.String
DEFAULT_PAG_NEXT_STYLE
static java.lang.String
DEFAULT_PAG_PREV_STYLE
static java.lang.String
DEFAULT_PAG_SIZE_FIELD
static java.lang.String
DEFAULT_PAG_STYLE
static int
DEFAULT_PAGE_SIZE
Pagination settings and defaults.static java.lang.String
DEFAULT_SORT_FIELD_ASC_STYLE
static java.lang.String
DEFAULT_SORT_FIELD_DESC_STYLE
static java.lang.String
DEFAULT_SORT_FIELD_STYLE
Sort field default styles.protected java.util.List<ModelForm.FieldGroupBase>
fieldGroupList
This is a list of FieldGroups in the order they were created.protected java.util.Map<java.lang.String,ModelForm.FieldGroupBase>
fieldGroupMap
This Map is keyed with the field name and has a FieldGroup for the value.protected java.util.List<ModelFormField>
fieldList
This List will contain one copy of each field for each field name in the order they were encountered in the service, entity, or form definition; field definitions with constraints will also be in this list but may appear multiple times for the same field name.static int
MAX_PAGE_SIZE
static java.lang.String
module
-
Fields inherited from class org.apache.ofbiz.widget.model.ModelWidget
enableBoundaryCommentsParam
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelForm(org.w3c.dom.Element formElement, java.lang.String formLocation, ModelReader entityModelReader, DispatchContext dispatchContext, java.lang.String defaultType)
XML Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<ModelAction>
getActions()
java.util.List<ModelForm.AltRowStyle>
getAltRowStyles()
java.util.List<ModelForm.AltTarget>
getAltTargets()
java.util.List<ModelForm.AutoFieldsEntity>
getAutoFieldsEntities()
java.util.List<ModelForm.AutoFieldsService>
getAutoFieldsServices()
java.lang.String
getBoundaryCommentName()
Returns the widget's name to be used in boundary comments.boolean
getClientAutocompleteFields()
java.lang.String
getContainerId()
java.lang.String
getContainerStyle()
java.lang.String
getDefaultEntityName()
ModelForm.FieldGroup
getDefaultFieldGroup()
java.util.Map<java.lang.String,? extends java.lang.Object>
getDefaultMap(java.util.Map<java.lang.String,? extends java.lang.Object> context)
java.lang.String
getDefaultMapName()
java.lang.String
getDefaultRequiredFieldStyle()
java.lang.String
getDefaultServiceName()
java.lang.String
getDefaultSortFieldAscStyle()
java.lang.String
getDefaultSortFieldDescStyle()
java.lang.String
getDefaultSortFieldStyle()
java.lang.String
getDefaultTableStyle()
java.lang.String
getDefaultTitleAreaStyle()
java.lang.String
getDefaultTitleStyle()
java.lang.String
getDefaultTooltipStyle()
int
getDefaultViewSize()
java.lang.String
getDefaultWidgetAreaStyle()
java.lang.String
getDefaultWidgetStyle()
java.lang.String
getEmptyFormDataMessage(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getEvenRowStyle()
java.util.List<ModelForm.FieldGroupBase>
getFieldGroupList()
java.util.Map<java.lang.String,ModelForm.FieldGroupBase>
getFieldGroupMap()
java.util.List<ModelFormField>
getFieldList()
java.lang.String
getFocusFieldName()
java.lang.String
getFormLocation()
java.lang.String
getFormTitleAreaStyle()
java.lang.String
getFormWidgetAreaStyle()
boolean
getGroupColumns()
java.lang.String
getHeaderRowStyle()
boolean
getHideHeader()
java.lang.String
getItemIndexSeparator()
java.util.List<java.lang.String>
getLastOrderFields()
java.lang.String
getListEntryName()
java.lang.String
getListName()
java.lang.String
getMultiPaginateIndexField(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getMultiPaginateSizeField(java.util.Map<java.lang.String,java.lang.Object> context)
java.util.List<ModelFormField>
getMultiSubmitFields()
java.lang.String
getOddRowStyle()
java.util.List<ModelForm.UpdateArea>
getOnPaginateUpdateAreas()
java.util.List<ModelForm.UpdateArea>
getOnSortColumnUpdateAreas()
java.util.List<ModelForm.UpdateArea>
getOnSubmitUpdateAreas()
java.lang.String
getOverrideListSize()
int
getOverrideListSize(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginate()
boolean
getPaginate(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateFirstLabel()
java.lang.String
getPaginateFirstLabel(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateFirstStyle()
java.lang.String
getPaginateIndexField()
java.lang.String
getPaginateIndexField(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateLastLabel()
java.lang.String
getPaginateLastLabel(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateLastStyle()
java.lang.String
getPaginateNextLabel()
java.lang.String
getPaginateNextLabel(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateNextStyle()
java.lang.String
getPaginatePreviousLabel()
java.lang.String
getPaginatePreviousLabel(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginatePreviousStyle()
java.lang.String
getPaginateSizeField()
java.lang.String
getPaginateSizeField(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateStyle()
java.lang.String
getPaginateTarget()
java.lang.String
getPaginateTarget(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getPaginateTargetAnchor()
java.lang.String
getPaginateViewSizeLabel()
java.lang.String
getPaginateViewSizeLabel(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getParentFormLocation()
java.lang.String
getParentFormName()
protected abstract ModelForm
getParentModel(org.w3c.dom.Element formElement, ModelReader entityModelReader, DispatchContext dispatchContext)
ModelForm
getParentModelForm()
java.lang.String
getPassedRowCount(java.util.Map<java.lang.String,java.lang.Object> context)
java.util.List<ModelAction>
getRowActions()
java.lang.String
getRowCount()
boolean
getSeparateColumns()
boolean
getSkipEnd()
boolean
getSkipStart()
java.lang.String
getSortField(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getSortFieldParameterName()
java.util.List<ModelForm.SortField>
getSortOrderFields()
java.lang.String
getStyleAltRowStyle(java.util.Map<java.lang.String,java.lang.Object> context)
iterate through alt-row-styles list to see if should be used, then add stylejava.lang.String
getTarget()
java.lang.String
getTarget(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.String targetType)
iterate through altTargets list to see if any should be used, if not return original targetjava.lang.String
getTargetType()
java.lang.String
getTargetWindow()
java.lang.String
getTargetWindow(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getTitle()
java.lang.String
getTooltip()
java.lang.String
getType()
boolean
getUseRowSubmit()
java.util.Set<java.lang.String>
getUseWhenFields()
boolean
isOverridenListSize()
void
runFormActions(java.util.Map<java.lang.String,java.lang.Object> context)
-
Methods inherited from class org.apache.ofbiz.widget.model.ModelWidget
accept, getName, getStartColumn, getStartLine, getSystemId, toString, widgetBoundaryCommentsEnabled
-
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
DEFAULT_FORM_RESULT_LIST_NAME
public static final java.lang.String DEFAULT_FORM_RESULT_LIST_NAME
- See Also:
- Constant Field Values
-
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE
Pagination settings and defaults.- See Also:
- Constant Field Values
-
MAX_PAGE_SIZE
public static final int MAX_PAGE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_PAG_INDEX_FIELD
public static final java.lang.String DEFAULT_PAG_INDEX_FIELD
- See Also:
- Constant Field Values
-
DEFAULT_PAG_SIZE_FIELD
public static final java.lang.String DEFAULT_PAG_SIZE_FIELD
- See Also:
- Constant Field Values
-
DEFAULT_PAG_STYLE
public static final java.lang.String DEFAULT_PAG_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_PAG_FIRST_STYLE
public static final java.lang.String DEFAULT_PAG_FIRST_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_PAG_PREV_STYLE
public static final java.lang.String DEFAULT_PAG_PREV_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_PAG_NEXT_STYLE
public static final java.lang.String DEFAULT_PAG_NEXT_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_PAG_LAST_STYLE
public static final java.lang.String DEFAULT_PAG_LAST_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_SORT_FIELD_STYLE
public static final java.lang.String DEFAULT_SORT_FIELD_STYLE
Sort field default styles.- See Also:
- Constant Field Values
-
DEFAULT_SORT_FIELD_ASC_STYLE
public static final java.lang.String DEFAULT_SORT_FIELD_ASC_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_SORT_FIELD_DESC_STYLE
public static final java.lang.String DEFAULT_SORT_FIELD_DESC_STYLE
- See Also:
- Constant Field Values
-
fieldGroupList
protected final java.util.List<ModelForm.FieldGroupBase> fieldGroupList
This is a list of FieldGroups in the order they were created. Can also include Banner objects.
-
fieldGroupMap
protected final java.util.Map<java.lang.String,ModelForm.FieldGroupBase> fieldGroupMap
This Map is keyed with the field name and has a FieldGroup for the value. Can also include Banner objects.
-
fieldList
protected final java.util.List<ModelFormField> fieldList
This List will contain one copy of each field for each field name in the order they were encountered in the service, entity, or form definition; field definitions with constraints will also be in this list but may appear multiple times for the same field name. When rendering the form the order in this list should be following and it should not be necessary to use the Map. The Map is used when loading the form definition to keep the list clean and implement the override features for field definitions.
-
-
Constructor Detail
-
ModelForm
protected ModelForm(org.w3c.dom.Element formElement, java.lang.String formLocation, ModelReader entityModelReader, DispatchContext dispatchContext, java.lang.String defaultType)
XML Constructor
-
-
Method Detail
-
getActions
public java.util.List<ModelAction> getActions()
-
getAltRowStyles
public java.util.List<ModelForm.AltRowStyle> getAltRowStyles()
-
getAltTargets
public java.util.List<ModelForm.AltTarget> getAltTargets()
-
getAutoFieldsEntities
public java.util.List<ModelForm.AutoFieldsEntity> getAutoFieldsEntities()
-
getAutoFieldsServices
public java.util.List<ModelForm.AutoFieldsService> getAutoFieldsServices()
-
getBoundaryCommentName
public java.lang.String getBoundaryCommentName()
Description copied from class:ModelWidget
Returns the widget's name to be used in boundary comments. The default action is to return the widget's name. Derived classes can override this method to return a customized name.- Overrides:
getBoundaryCommentName
in classModelWidget
- Returns:
- Name to be used in boundary comments
-
getClientAutocompleteFields
public boolean getClientAutocompleteFields()
-
getContainerId
public java.lang.String getContainerId()
-
getContainerStyle
public java.lang.String getContainerStyle()
-
getDefaultEntityName
public java.lang.String getDefaultEntityName()
-
getDefaultFieldGroup
public ModelForm.FieldGroup getDefaultFieldGroup()
-
getDefaultMap
public java.util.Map<java.lang.String,? extends java.lang.Object> getDefaultMap(java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
getDefaultMapName
public java.lang.String getDefaultMapName()
-
getDefaultRequiredFieldStyle
public java.lang.String getDefaultRequiredFieldStyle()
-
getDefaultServiceName
public java.lang.String getDefaultServiceName()
-
getDefaultSortFieldAscStyle
public java.lang.String getDefaultSortFieldAscStyle()
-
getDefaultSortFieldDescStyle
public java.lang.String getDefaultSortFieldDescStyle()
-
getDefaultSortFieldStyle
public java.lang.String getDefaultSortFieldStyle()
-
getDefaultTableStyle
public java.lang.String getDefaultTableStyle()
-
getDefaultTitleAreaStyle
public java.lang.String getDefaultTitleAreaStyle()
-
getDefaultTitleStyle
public java.lang.String getDefaultTitleStyle()
-
getDefaultTooltipStyle
public java.lang.String getDefaultTooltipStyle()
-
getDefaultViewSize
public int getDefaultViewSize()
-
getDefaultWidgetAreaStyle
public java.lang.String getDefaultWidgetAreaStyle()
-
getDefaultWidgetStyle
public java.lang.String getDefaultWidgetStyle()
-
getEvenRowStyle
public java.lang.String getEvenRowStyle()
-
getFieldGroupList
public java.util.List<ModelForm.FieldGroupBase> getFieldGroupList()
-
getFieldGroupMap
public java.util.Map<java.lang.String,ModelForm.FieldGroupBase> getFieldGroupMap()
-
getFieldList
public java.util.List<ModelFormField> getFieldList()
-
getFocusFieldName
public java.lang.String getFocusFieldName()
-
getFormLocation
public java.lang.String getFormLocation()
-
getFormTitleAreaStyle
public java.lang.String getFormTitleAreaStyle()
-
getFormWidgetAreaStyle
public java.lang.String getFormWidgetAreaStyle()
-
getHeaderRowStyle
public java.lang.String getHeaderRowStyle()
-
getHideHeader
public boolean getHideHeader()
-
getItemIndexSeparator
public java.lang.String getItemIndexSeparator()
-
getLastOrderFields
public java.util.List<java.lang.String> getLastOrderFields()
-
getListEntryName
public java.lang.String getListEntryName()
-
getListName
public java.lang.String getListName()
-
getMultiPaginateIndexField
public java.lang.String getMultiPaginateIndexField(java.util.Map<java.lang.String,java.lang.Object> context)
-
getMultiPaginateSizeField
public java.lang.String getMultiPaginateSizeField(java.util.Map<java.lang.String,java.lang.Object> context)
-
getMultiSubmitFields
public java.util.List<ModelFormField> getMultiSubmitFields()
-
getOddRowStyle
public java.lang.String getOddRowStyle()
-
getOnPaginateUpdateAreas
public java.util.List<ModelForm.UpdateArea> getOnPaginateUpdateAreas()
-
getOnSortColumnUpdateAreas
public java.util.List<ModelForm.UpdateArea> getOnSortColumnUpdateAreas()
-
getOnSubmitUpdateAreas
public java.util.List<ModelForm.UpdateArea> getOnSubmitUpdateAreas()
-
getOverrideListSize
public java.lang.String getOverrideListSize()
-
getOverrideListSize
public int getOverrideListSize(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginate
public java.lang.String getPaginate()
-
getPaginate
public boolean getPaginate(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateFirstLabel
public java.lang.String getPaginateFirstLabel()
-
getPaginateFirstLabel
public java.lang.String getPaginateFirstLabel(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateFirstStyle
public java.lang.String getPaginateFirstStyle()
-
getPaginateIndexField
public java.lang.String getPaginateIndexField()
-
getPaginateIndexField
public java.lang.String getPaginateIndexField(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateLastLabel
public java.lang.String getPaginateLastLabel()
-
getPaginateLastLabel
public java.lang.String getPaginateLastLabel(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateLastStyle
public java.lang.String getPaginateLastStyle()
-
getPaginateNextLabel
public java.lang.String getPaginateNextLabel()
-
getPaginateNextLabel
public java.lang.String getPaginateNextLabel(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateNextStyle
public java.lang.String getPaginateNextStyle()
-
getPaginatePreviousLabel
public java.lang.String getPaginatePreviousLabel()
-
getPaginatePreviousLabel
public java.lang.String getPaginatePreviousLabel(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginatePreviousStyle
public java.lang.String getPaginatePreviousStyle()
-
getPaginateSizeField
public java.lang.String getPaginateSizeField()
-
getPaginateSizeField
public java.lang.String getPaginateSizeField(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateStyle
public java.lang.String getPaginateStyle()
-
getPaginateTarget
public java.lang.String getPaginateTarget()
-
getPaginateTarget
public java.lang.String getPaginateTarget(java.util.Map<java.lang.String,java.lang.Object> context)
-
getPaginateTargetAnchor
public java.lang.String getPaginateTargetAnchor()
-
getPaginateViewSizeLabel
public java.lang.String getPaginateViewSizeLabel()
-
getPaginateViewSizeLabel
public java.lang.String getPaginateViewSizeLabel(java.util.Map<java.lang.String,java.lang.Object> context)
-
getParentModel
protected abstract ModelForm getParentModel(org.w3c.dom.Element formElement, ModelReader entityModelReader, DispatchContext dispatchContext)
-
getParentFormLocation
public java.lang.String getParentFormLocation()
-
getParentFormName
public java.lang.String getParentFormName()
-
getParentModelForm
public ModelForm getParentModelForm()
-
getPassedRowCount
public java.lang.String getPassedRowCount(java.util.Map<java.lang.String,java.lang.Object> context)
-
getRowActions
public java.util.List<ModelAction> getRowActions()
-
getRowCount
public java.lang.String getRowCount()
-
getSeparateColumns
public boolean getSeparateColumns()
-
getSkipEnd
public boolean getSkipEnd()
-
getSkipStart
public boolean getSkipStart()
-
getSortField
public java.lang.String getSortField(java.util.Map<java.lang.String,java.lang.Object> context)
-
getSortFieldParameterName
public java.lang.String getSortFieldParameterName()
-
getSortOrderFields
public java.util.List<ModelForm.SortField> getSortOrderFields()
-
getStyleAltRowStyle
public java.lang.String getStyleAltRowStyle(java.util.Map<java.lang.String,java.lang.Object> context)
iterate through alt-row-styles list to see if should be used, then add style- Returns:
- The style for item row
-
getTarget
public java.lang.String getTarget()
-
getTarget
public java.lang.String getTarget(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.String targetType)
iterate through altTargets list to see if any should be used, if not return original target- Returns:
- The target for this Form
-
getTargetType
public java.lang.String getTargetType()
-
getTargetWindow
public java.lang.String getTargetWindow()
-
getTargetWindow
public java.lang.String getTargetWindow(java.util.Map<java.lang.String,java.lang.Object> context)
-
getTitle
public java.lang.String getTitle()
-
getEmptyFormDataMessage
public java.lang.String getEmptyFormDataMessage(java.util.Map<java.lang.String,java.lang.Object> context)
-
getTooltip
public java.lang.String getTooltip()
-
getType
public java.lang.String getType()
-
getUseRowSubmit
public boolean getUseRowSubmit()
-
getUseWhenFields
public java.util.Set<java.lang.String> getUseWhenFields()
-
getGroupColumns
public boolean getGroupColumns()
-
isOverridenListSize
public boolean isOverridenListSize()
-
runFormActions
public void runFormActions(java.util.Map<java.lang.String,java.lang.Object> context)
-
-