Package de.xima.fc.form.common.models
Interface IXItemBasic
-
- All Known Subinterfaces:
IXItem
,IXItemAppendable
,IXItemWidget
- All Known Implementing Classes:
XAppointment
,XButtonList
,XCheckbox
,XContainer
,XContainerInvisible
,XDefault
,XFieldSet
,XFooter
,XHeader
,XImage
,XLine
,XPage
,XSelect
,XSpacer
,XSpan
,XTextArea
,XTextField
,XUpload
public interface IXItemBasic
The base interface for all built-in form items and all widgets provided by plugins.- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
getAutoReRender()
ArrayList<XItemPropertyDesc>
getAvailableProperties(Locale locale)
String
getIcon()
String
getPrefix()
Finds the prefix for form items of this type, such ascb
for checkboxes ortf
for input fields.default boolean
isShouldRenderForAttributeOnLabel(XItemRenderData renderData)
Whether thefor
should be added to the label of this element, if this element does have a label.default boolean
isShouldRenderUnit(XItemRenderData renderData)
Whether theXPropertyEnum.unit
should be rendered.default boolean
isShowInDrawerPanel()
Controls whether this element type appears as an icon in the drawer panel on the left-hand side of the designer.default boolean
isShowInElementSelect()
Controls whether this element type can be selected in the type selection in the properties panel on the the right-hand side of the designer.boolean
isSubmitsValues()
Checks whether form items of this type can send values to the server when the form is submitted.default IXProcessUploadResult
processUpload(IXProcessUploadParams params)
void
renderItem(com.hp.gagawa.java.elements.Div container, XItemRenderData renderData, XItemRenderCtx renderCtx, IXFormRenderContext formRenderCtx)
Creates the HTML for this form item that is included in the final rendered form.default void
renderItemPreview(com.hp.gagawa.java.elements.Div container, XItemRenderData renderData, XItemRenderCtx renderCtx, IXFormRenderContext formRenderCtx)
Similar to therenderItem(Div, XItemRenderData, XItemRenderCtx, IXFormRenderContext)
method, but this is called when the form is viewed in the designer.default List<IXValidationResult>
validate(IXValidationParams params)
Validates the values that were submitted for this form item.default IXValidationResult
validate(List<String[]> values, Locale locale, Map<Serializable,Serializable> frqSessionAttributes)
Deprecated.default boolean
validateGlobal(IXGlobalValidationParams params)
Validates the values that were submitted for all form items of this kind.
-
-
-
Method Detail
-
getAutoReRender
default boolean getAutoReRender()
- Returns:
true
to render the item automatically in the designer, orfalse
otherwise. When set tofalse
, you will need to display the item via JavaScript yourself.
-
getAvailableProperties
ArrayList<XItemPropertyDesc> getAvailableProperties(Locale locale)
- Parameters:
locale
- The current locale that can be used for locale dependent properties.- Returns:
- A list of all properties
-
getIcon
String getIcon()
- Returns:
- The CSS class for the icon of this form item, such as for example
ico-fc-XCheckbox
.
-
getPrefix
String getPrefix()
Finds the prefix for form items of this type, such ascb
for checkboxes ortf
for input fields. This prefix is used, for example, in the designer to generate a default name for newly added form items (tf-1
,cb-2
).- Returns:
- The prefix for form items of this type.
-
isShouldRenderUnit
default boolean isShouldRenderUnit(XItemRenderData renderData)
Whether theXPropertyEnum.unit
should be rendered. Note that the unit is rendered only when the item contains the propertyXPropertyEnum.unit
and its value is not empty. However, some elements may sometimes not support a unit. For example,XSelect
only support a unit when the it is rendered as a combo box, but not when rendered as a list of checkboxes. In these cases, you can override this method with an appropriate implementation. The default implementation simply returnstrue
.- Parameters:
renderData
- The current render data with the properties and options of the item.- Returns:
true
when theXPropertyEnum.unit
should be rendered, orfalse
otherwise.
-
isSubmitsValues
boolean isSubmitsValues()
Checks whether form items of this type can send values to the server when the form is submitted. Form items that do not submit values are, for example, not validated and no values are ever stored in the database. Form items such as pictures or charts do no submit values, while classical form elements such as input fields and checkboxes are a prime example of form items that do submit values.- Returns:
- Whether form element of this type can send values to the server when the form is submitted.
-
isShowInDrawerPanel
default boolean isShowInDrawerPanel()
Controls whether this element type appears as an icon in the drawer panel on the left-hand side of the designer. These icons can be used to add a new element to the form via drag & drop. Defaults totrue
.- Returns:
- Whether to show this element type in the drawer panel.
- Since:
- 8.0.0
-
isShowInElementSelect
default boolean isShowInElementSelect()
Controls whether this element type can be selected in the type selection in the properties panel on the the right-hand side of the designer. The type selection can be used to convert e.g. an input field into a text area. Defaults totrue
.- Returns:
- Whether to show this element type in the type select menu.
- Since:
- 8.0.0
-
isShouldRenderForAttributeOnLabel
default boolean isShouldRenderForAttributeOnLabel(XItemRenderData renderData)
Whether thefor
should be added to the label of this element, if this element does have a label. The W3C spec requires that thefor
points to a non-hidden form control element (e.g. aninput
ortextarea
). Defaults totrue
.- Parameters:
renderData
- The current render data with the properties and options of the item.- Returns:
- Whether to include the
for
in the label.
-
renderItem
void renderItem(com.hp.gagawa.java.elements.Div container, XItemRenderData renderData, XItemRenderCtx renderCtx, IXFormRenderContext formRenderCtx)
Creates the HTML for this form item that is included in the final rendered form. You should append one or more HTML elements to the container that is passed to this method.- Parameters:
container
- The container that will contain this form item in the final form. You should append children to this container.renderData
- The current render data with the properties and options of the item.renderCtx
- The current render context giving you access to the global configuration.formRenderCtx
- The form render context giving you access to the global form configuration.- See Also:
renderItemPreview(Div, XItemRenderData, XItemRenderCtx, IXFormRenderContext)
-
renderItemPreview
default void renderItemPreview(com.hp.gagawa.java.elements.Div container, XItemRenderData renderData, XItemRenderCtx renderCtx, IXFormRenderContext formRenderCtx)
Similar to therenderItem(Div, XItemRenderData, XItemRenderCtx, IXFormRenderContext)
method, but this is called when the form is viewed in the designer. You can, if necessary, render the form slightly differently in the desigern. This is useful, for example, when when you do not want users to be able to interact with the form element directly in the designer preview area.- Parameters:
container
- The container that will contain this form item in the final form. You should append children to this container.renderData
- The current render data with the properties and options of the item.renderCtx
- The current render context giving you access to the global configuration.formRenderCtx
- The form render context giving you access to the global form configuration.- See Also:
renderItem(Div, XItemRenderData, XItemRenderCtx, IXFormRenderContext)
-
validate
default List<IXValidationResult> validate(IXValidationParams params)
Validates the values that were submitted for this form item. This method is always called, even when server-side validation is not enabled (XPropertyEnum.servervalidate
). In case you do not want to perform any validation when server-side validation is disabled, check whether the propertyXPropertyEnum.servervalidate
is set.In case validation fails, the form submission is not accepted and an appropriate error message is shown to the form user.
- Parameters:
params
- Parameters for the validation process the item can make use of, such as the submitted values.- Returns:
- A list with a validation result for each value of the
IXValidationParams.getValues()
. Each result indicating whether the submitted values are valid.
-
validate
@Deprecated default IXValidationResult validate(List<String[]> values, Locale locale, Map<Serializable,Serializable> frqSessionAttributes)
Deprecated.Validates the values that were submitted for this form item. This method is always called, even when server-side validation is not enabled (XPropertyEnum.servervalidate
). In case you do not want to perform any validation when server-side validation is disabled, check whether the propertyXPropertyEnum.servervalidate
is set.In case validation fails, the form submission is not accepted and an appropriate error message is shown to the form user.
- Parameters:
values
- The values that were submitted for this form item.locale
- The current locale to be used for creating error messages.frqSessionAttributes
- All attributes from the current form request session.- Returns:
- A result indicating whether the submitted values are valid.
-
validateGlobal
default boolean validateGlobal(IXGlobalValidationParams params)
Validates the values that were submitted for all form items of this kind. This method is always called, after other validations have been performed, even when server-side validation is not enabled (XPropertyEnum.servervalidate
). In case you do not want to perform any validation when server-side validation is disabled, check whether the propertyXPropertyEnum.servervalidate
is set.In case validation fails, the form submission is not accepted and an appropriate error message is shown to the form user.
- Parameters:
params
- Parameters for the validation process the item can make use of, such as the submitted values.- Returns:
true
if all items are valid, orfalse
otherwise. To add an error message for a certain item, useIXFormRenderConfig.addValidationError(String, String)
of theIXBaseValidationParams.getFormRenderConfig()
.
-
processUpload
default IXProcessUploadResult processUpload(IXProcessUploadParams params) throws IOException
- Throws:
IOException
-
-