Class UIListCustomWidget
- All Implemented Interfaces:
UIWidget
Custom widgets handling non-list elements must extend UISimpleCustomWidget
.
Factories
Along with the widget itself, a factory must be provided. Such a factory must implement UIWidgetFactory
.
For instance, for a custom widget MyCustomWidget
, it is advisable to create the associated
factory MyCustomWidgetFactory
.
Usage
Model driven
Like a UIBeanEditor
, a custom widget can be specified as the default view of a data model element
(a field or a group that is terminal or under a terminal group).
In addition, thanks to the fact that a factory is now specified, it becomes possible to control
whether the specified widget is relevant with regards to the data model element.
If it is not the case, an error can be added to the data model compilation
(see UIWidgetFactory.setup(WidgetFactorySetupContext)
.
In Java API
A custom widget can be specifically instantiated and embedded in custom layouts (UIForm
),
custom user services (UserService
) and in other custom widgets.
Life cycle
- When a session of EBX® generates an HTTP response including a custom widget, the specified class is instantiated by its factory.
- When the page generated in the previous step is submitted and the server receives the corresponding HTTP request, it is the same instance that is responsible for handling the parameters of the HTTP request, supplying the data context and checking its integrity.
- Since:
- 5.8.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUIListCustomWidget
(Path aNodePath, WidgetFactoryContext aContext) UIListCustomWidget
(WidgetFactoryContext aContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(WidgetListValidationContext aValidationContext) Offers the opportunity to perform a custom validation upon user input.abstract void
write
(WidgetWriterForList aWriter, WidgetDisplayContext aContext) This method defines how to display the widget.Methods inherited from class com.orchestranetworks.ui.form.widget.UICustomWidget
isDisplayingCustomWidgetValidationMessage, isEditorDisabled, setEditorDisabled
-
Constructor Details
-
UIListCustomWidget
-
UIListCustomWidget
-
-
Method Details
-
write
This method defines how to display the widget. -
validate
Offers the opportunity to perform a custom validation upon user input.A common use case consists in retrieving the HTTP parameter values from the incoming context, checking them, then supplying the validation context with the converted values. Error messages can be provided to the validation context if needed.
Default implementation does nothing.
This method is not called if
UICustomWidget.isEditorDisabled()
returns true.This method is not called by the Ajax validation mechanism. See
UIAtomicWidget.setAjaxPrevalidationEnabled(boolean)
for more information.
-