Package org.apache.ofbiz.widget.model
Class ModelFormField
- java.lang.Object
-
- org.apache.ofbiz.widget.model.ModelFormField
-
public class ModelFormField extends java.lang.Object
Models the <field> element.- See Also:
widget-form.xsd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModelFormField.AutoComplete
Models the <auto-complete> element.static class
ModelFormField.CheckField
Models the <check> element.static class
ModelFormField.ContainerField
Models the <container> element.static class
ModelFormField.DateFindField
Models the <date-find> element.static class
ModelFormField.DateTimeField
Models the <date-time> element.static class
ModelFormField.DisplayEntityField
Models the <display-entity> element.static class
ModelFormField.DisplayField
Models the <display> element.static class
ModelFormField.DropDownField
Models the <drop-down> element.static class
ModelFormField.EntityOptions
Models the <entity-options> element.static class
ModelFormField.FieldInfoWithOptions
static class
ModelFormField.FileField
Models the <file> element.static class
ModelFormField.FormField
Models the <include-form> element.static class
ModelFormField.GridField
Models the <include-grid> element.static class
ModelFormField.HiddenField
Models the <hidden> element.static class
ModelFormField.HyperlinkField
Models the <hyperlink> element.static class
ModelFormField.IgnoredField
Models the <ignored> element.static class
ModelFormField.ImageField
Models the <image> element.static class
ModelFormField.InPlaceEditor
Models the <in-place-editor> element.static class
ModelFormField.ListOptions
Models the <list-options> element.static class
ModelFormField.LookupField
Models the <lookup> element.static class
ModelFormField.MenuField
Models the <include-menu> element.static class
ModelFormField.OptionSource
static class
ModelFormField.OptionValue
static class
ModelFormField.PasswordField
Models the <password> element.static class
ModelFormField.RadioField
Models the <radio> element.static class
ModelFormField.RangeFindField
Models the <range-find> element.static class
ModelFormField.ResetField
Models the <reset> element.static class
ModelFormField.ScreenField
Models the <include-screen> element.static class
ModelFormField.SingleOption
Models the <option> element.static class
ModelFormField.SubHyperlink
Models the <sub-hyperlink> element.static class
ModelFormField.SubmitField
Models the <submit> element.static class
ModelFormField.TextareaField
Models the <textarea> element.static class
ModelFormField.TextField
Models the <text> element.static class
ModelFormField.TextFindField
Models the <text-find> element.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
fieldName
protected ModelForm
modelForm
static java.lang.String
module
protected java.lang.String
name
protected FlexibleStringExpander
parameterName
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ModelFormField
from(ModelFormFieldBuilder builder)
FlexibleStringExpander
getAction()
java.lang.String
getAction(java.util.Map<java.lang.String,? extends java.lang.Object> context)
java.lang.String
getAttributeName()
Gets the name of the Service Attribute (aka Parameter) that corresponds with this field.java.lang.String
getConditionGroup()
java.lang.String
getCurrentContainerId(java.util.Map<java.lang.String,java.lang.Object> context)
Gets the current id name of theModelFormField
and if in a multi typeModelForm
, suffixes it with the index row.boolean
getEncodeOutput()
java.lang.String
getEntityName()
java.lang.String
getEntry(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Gets the entry from the context that corresponds to this field; if this form is being rendered in an error condition (ie isError in the context is true) then the value will be retrieved from the parameters Map in the context.java.lang.String
getEntry(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.String defaultValue)
FlexibleMapAccessor<java.lang.Object>
getEntryAcsr()
java.lang.String
getEntryName()
java.lang.String
getEvent()
FieldInfo
getFieldInfo()
java.lang.String
getFieldName()
Gets the name of the Entity Field that corresponds with this field.java.lang.String
getHeaderLink()
java.lang.String
getHeaderLinkStyle()
java.lang.String
getIdName()
Gets the id name of theModelFormField
that is : The id-name" specified on the field definition Else the concatenation of the formName and fieldNamejava.lang.String
getIgnoreWhen(java.util.Map<java.lang.String,java.lang.Object> context)
java.util.Map<java.lang.String,? extends java.lang.Object>
getMap(java.util.Map<java.lang.String,? extends java.lang.Object> context)
FlexibleMapAccessor<java.util.Map<java.lang.String,? extends java.lang.Object>>
getMapAcsr()
java.lang.String
getMapName()
Get the name of the Map in the form context that contains the entry, available from the getEntryName() method.ModelForm
getModelForm()
java.lang.String
getName()
java.util.List<ModelForm.UpdateArea>
getOnChangeUpdateAreas()
java.util.List<ModelForm.UpdateArea>
getOnClickUpdateAreas()
FlexibleStringExpander
getParameterName()
java.lang.String
getParameterName(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Get the name to use for the parameter for this field in the form interpreter.java.lang.String
getParentFormName()
int
getPosition()
java.lang.String
getRedWhen()
boolean
getRequiredField()
java.lang.String
getRequiredFieldStyle()
boolean
getSeparateColumn()
java.lang.String
getServiceName()
java.lang.Boolean
getSortField()
java.lang.String
getSortFieldAscStyle()
java.lang.String
getSortFieldDescStyle()
java.lang.String
getSortFieldHelpText()
java.lang.String
getSortFieldHelpText(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getSortFieldStyle()
java.lang.String
getSortFieldStyleAsc()
java.lang.String
getSortFieldStyleDesc()
java.lang.String
getTabindex()
FlexibleStringExpander
getTitle()
java.lang.String
getTitle(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getTitleAreaStyle()
java.lang.String
getTitleStyle()
FlexibleStringExpander
getTooltip()
java.lang.String
getTooltip(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getTooltipStyle()
FlexibleStringExpander
getUseWhen()
java.lang.String
getUseWhen(java.util.Map<java.lang.String,java.lang.Object> context)
java.lang.String
getWidgetAreaStyle()
java.lang.String
getWidgetStyle()
boolean
isRowSubmit()
Checks if field is a row submit field.boolean
isSortField()
boolean
isUseWhenEmpty()
void
renderFieldString(java.lang.Appendable writer, java.util.Map<java.lang.String,java.lang.Object> context, FormStringRenderer formStringRenderer)
boolean
shouldBeRed(java.util.Map<java.lang.String,java.lang.Object> context)
the widget/interaction part will be red if the date value is before-now (for ex.boolean
shouldIgnore(java.util.Map<java.lang.String,java.lang.Object> context)
boolean
shouldUse(java.util.Map<java.lang.String,java.lang.Object> context)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
fieldName
protected final java.lang.String fieldName
-
modelForm
protected final ModelForm modelForm
-
name
protected final java.lang.String name
-
parameterName
protected final FlexibleStringExpander parameterName
-
-
Method Detail
-
from
public static ModelFormField from(ModelFormFieldBuilder builder)
-
getAction
public FlexibleStringExpander getAction()
-
getAction
public java.lang.String getAction(java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
getAttributeName
public java.lang.String getAttributeName()
Gets the name of the Service Attribute (aka Parameter) that corresponds with this field. This can be used to get additional information about the field. Use the getServiceName() method to get the Entity name that the field is in.- Returns:
- returns the name of the Service Attribute
-
getCurrentContainerId
public java.lang.String getCurrentContainerId(java.util.Map<java.lang.String,java.lang.Object> context)
Gets the current id name of theModelFormField
and if in a multi typeModelForm
, suffixes it with the index row.- Parameters:
context
-- Returns:
-
getEncodeOutput
public boolean getEncodeOutput()
-
getEntityName
public java.lang.String getEntityName()
-
getEntry
public java.lang.String getEntry(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Gets the entry from the context that corresponds to this field; if this form is being rendered in an error condition (ie isError in the context is true) then the value will be retrieved from the parameters Map in the context.- Parameters:
context
- the context- Returns:
- returns the entry from the context that corresponds to this field
-
getEntry
public java.lang.String getEntry(java.util.Map<java.lang.String,? extends java.lang.Object> context, java.lang.String defaultValue)
-
getEntryAcsr
public FlexibleMapAccessor<java.lang.Object> getEntryAcsr()
-
getEntryName
public java.lang.String getEntryName()
-
getEvent
public java.lang.String getEvent()
-
getFieldInfo
public FieldInfo getFieldInfo()
-
getFieldName
public java.lang.String getFieldName()
Gets the name of the Entity Field that corresponds with this field. This can be used to get additional information about the field. Use the getEntityName() method to get the Entity name that the field is in.- Returns:
- return the name of the Entity Field that corresponds with this field
-
getHeaderLink
public java.lang.String getHeaderLink()
-
getHeaderLinkStyle
public java.lang.String getHeaderLinkStyle()
-
getIdName
public java.lang.String getIdName()
Gets the id name of theModelFormField
that is :- The id-name" specified on the field definition
- Else the concatenation of the formName and fieldName
- Returns:
-
getTabindex
public java.lang.String getTabindex()
-
getConditionGroup
public java.lang.String getConditionGroup()
-
getMap
public java.util.Map<java.lang.String,? extends java.lang.Object> getMap(java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
getMapAcsr
public FlexibleMapAccessor<java.util.Map<java.lang.String,? extends java.lang.Object>> getMapAcsr()
-
getMapName
public java.lang.String getMapName()
Get the name of the Map in the form context that contains the entry, available from the getEntryName() method. This entry is used to pre-populate the field widget when not in an error condition. In an error condition the parameter name is used to get the value from the parameters Map.- Returns:
- returns the name of the Map in the form context that contains the entry
-
getModelForm
public ModelForm getModelForm()
-
getName
public java.lang.String getName()
-
getOnChangeUpdateAreas
public java.util.List<ModelForm.UpdateArea> getOnChangeUpdateAreas()
-
getOnClickUpdateAreas
public java.util.List<ModelForm.UpdateArea> getOnClickUpdateAreas()
-
getParameterName
public FlexibleStringExpander getParameterName()
-
getParameterName
public java.lang.String getParameterName(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Get the name to use for the parameter for this field in the form interpreter. For HTML forms this is the request parameter name.- Returns:
- returns the name to use for the parameter for this field in the form interpreter
-
getPosition
public int getPosition()
-
getRedWhen
public java.lang.String getRedWhen()
-
getRequiredField
public boolean getRequiredField()
-
getRequiredFieldStyle
public java.lang.String getRequiredFieldStyle()
-
getSeparateColumn
public boolean getSeparateColumn()
-
getServiceName
public java.lang.String getServiceName()
-
getSortField
public java.lang.Boolean getSortField()
-
getSortFieldAscStyle
public java.lang.String getSortFieldAscStyle()
-
getSortFieldDescStyle
public java.lang.String getSortFieldDescStyle()
-
getSortFieldHelpText
public java.lang.String getSortFieldHelpText()
-
getSortFieldHelpText
public java.lang.String getSortFieldHelpText(java.util.Map<java.lang.String,java.lang.Object> context)
-
getSortFieldStyle
public java.lang.String getSortFieldStyle()
-
getSortFieldStyleAsc
public java.lang.String getSortFieldStyleAsc()
-
getSortFieldStyleDesc
public java.lang.String getSortFieldStyleDesc()
-
getTitle
public FlexibleStringExpander getTitle()
-
getTitle
public java.lang.String getTitle(java.util.Map<java.lang.String,java.lang.Object> context)
-
getTitleAreaStyle
public java.lang.String getTitleAreaStyle()
-
getTitleStyle
public java.lang.String getTitleStyle()
-
getTooltip
public FlexibleStringExpander getTooltip()
-
getTooltip
public java.lang.String getTooltip(java.util.Map<java.lang.String,java.lang.Object> context)
-
getTooltipStyle
public java.lang.String getTooltipStyle()
-
getUseWhen
public FlexibleStringExpander getUseWhen()
-
getUseWhen
public java.lang.String getUseWhen(java.util.Map<java.lang.String,java.lang.Object> context)
-
getIgnoreWhen
public java.lang.String getIgnoreWhen(java.util.Map<java.lang.String,java.lang.Object> context)
-
getWidgetAreaStyle
public java.lang.String getWidgetAreaStyle()
-
getWidgetStyle
public java.lang.String getWidgetStyle()
-
getParentFormName
public java.lang.String getParentFormName()
-
isRowSubmit
public boolean isRowSubmit()
Checks if field is a row submit field.
-
isSortField
public boolean isSortField()
-
isUseWhenEmpty
public boolean isUseWhenEmpty()
-
renderFieldString
public void renderFieldString(java.lang.Appendable writer, java.util.Map<java.lang.String,java.lang.Object> context, FormStringRenderer formStringRenderer) throws java.io.IOException
- Throws:
java.io.IOException
-
shouldBeRed
public boolean shouldBeRed(java.util.Map<java.lang.String,java.lang.Object> context)
the widget/interaction part will be red if the date value is before-now (for ex. thruDate), after-now (for ex. fromDate), or by-name (if the field's name or entry-name or fromDate or thruDate the corresponding action will be done); only applicable when the field is a timestamp- Parameters:
context
- the context- Returns:
- true if the field should be read otherwise false
-
shouldUse
public boolean shouldUse(java.util.Map<java.lang.String,java.lang.Object> context)
-
shouldIgnore
public boolean shouldIgnore(java.util.Map<java.lang.String,java.lang.Object> context)
-
-