Package org.apache.ofbiz.widget.model
Class ModelFormField
java.lang.Object
org.apache.ofbiz.widget.model.ModelFormField
Models the <field> element.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Models the <auto-complete> element.static class
Models the <check> element.static class
Models the <container> element.static class
Models the <date-find> element.static class
Models the <date-time> element.static class
Models the <display-entity> element.static class
Models the <display> element.static class
Models the <drop-down> element.static class
Models the <entity-options> element.static class
static class
Models the <file> element.static class
Models the <include-form> element.static class
Models the <include-grid> element.static class
Models the <hidden> element.static class
Models the <hyperlink> element.static class
Models the <ignored> element.static class
Models the <image> element.static class
Models the <in-place-editor> element.static class
Models the <list-options> element.static class
Models the <lookup> element.static class
Models the <include-menu> element.static class
static class
static class
Models the <password> element.static class
Models the <radio> element.static class
Models the <range-find> element.static class
Models the <reset> element.static class
Models the <include-screen> element.static class
Models the <option> element.static class
Models the <sub-hyperlink> element.static class
Models the <submit> element.static class
Models the <textarea> element.static class
Models the <text> element.static class
Models the <text-find> element. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelFormField
from
(Consumer<ModelFormFieldBuilder> spec) Constructs a form field model from a builder specification.static ModelFormField
from
(ModelFormFieldBuilder builder) Gets the name of the Service Attribute (aka Parameter) that corresponds with this field.getCurrentContainerId
(Map<String, Object> context) Gets the current id name of theModelFormField
and if in a multi typeModelForm
, suffixes it with the index row.boolean
getDisabled
(Map<String, Object> context) boolean
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.getEvent()
Gets the name of the Entity Field that corresponds with this field.Gets the id name of theModelFormField
that is : The id-name" specified on the field definition Else the concatenation of the formName and fieldNamegetIgnoreWhen
(Map<String, Object> context) FlexibleMapAccessor<Map<String,
? extends Object>> Get the name of the Map in the form context that contains the entry, available from the getEntryName() method.getName()
getParameterName
(Map<String, ? extends Object> context) Get the name to use for the parameter for this field in the form interpreter.int
boolean
boolean
getSortFieldHelpText
(Map<String, Object> context) getTitle()
getTooltip
(Map<String, Object> context) getUseWhen
(Map<String, Object> context) boolean
Checks if field is a row submit field.boolean
boolean
void
renderFieldString
(Appendable writer, Map<String, Object> context, FormStringRenderer formStringRenderer) boolean
shouldBeRed
(Map<String, Object> context) the widget/interaction part will be red if the date value is before-now (for ex.boolean
shouldIgnore
(Map<String, Object> context) boolean
static Predicate<ModelFormField>
usedFields
(Map<String, Object> context) Provides a stateful predicate checking if a field must be used.
-
Method Details
-
from
Constructs a form field model from a builder specification.- Parameters:
spec
- the specification of form field definition- Returns:
- the form field model corresponding to the specification.
-
from
-
getAction
-
getAction
-
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
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
-
getEntry
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
-
getEntryAcsr
-
getEntryName
-
getEvent
-
getFieldInfo
-
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
-
getHeaderLinkStyle
-
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
-
getConditionGroup
-
getDisabledSpec
-
getDisabled
-
getMap
-
getMapAcsr
-
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
-
getName
-
getOnChangeUpdateAreas
-
getOnClickUpdateAreas
-
getParameterName
-
getParameterName
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
-
getRequiredField
public boolean getRequiredField() -
getRequiredFieldStyle
-
getSeparateColumn
public boolean getSeparateColumn() -
getServiceName
-
getSortField
-
getSortFieldAscStyle
-
getSortFieldDescStyle
-
getSortFieldHelpText
-
getSortFieldHelpText
-
getSortFieldStyle
-
getSortFieldStyleAsc
-
getSortFieldStyleDesc
-
getTitle
-
getTitle
-
getTitleAreaStyle
-
getTitleStyle
-
getTooltip
-
getTooltip
-
getTooltipStyle
-
getUseWhen
-
getUseWhen
-
getIgnoreWhen
-
getWidgetAreaStyle
-
getWidgetStyle
-
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(Appendable writer, Map<String, Object> context, FormStringRenderer formStringRenderer) throws IOException- Throws:
IOException
-
shouldBeRed
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
-
usedFields
Provides a stateful predicate checking if a field must be used.- Parameters:
context
- the context determining if the field must be used- Returns:
- a stateful predicate checking if a field must be used.
-
shouldIgnore
-