public abstract class UIListCustomWidget extends UICustomWidget
Custom widgets handling non-list elements must extend UISimpleCustomWidget
.
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
.
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)
.
A custom widget can be specifically instantiated and embedded in custom layouts (UIForm
),
custom user services (UserService
) and in other custom widgets.
UISimpleCustomWidget
,
UIWidgetFactory
Constructor and Description |
---|
UIListCustomWidget(Path aNodePath,
WidgetFactoryContext aContext) |
UIListCustomWidget(WidgetFactoryContext aContext) |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
isDisplayingCustomWidgetValidationMessage, isEditorDisabled, setEditorDisabled
public UIListCustomWidget(WidgetFactoryContext aContext)
public UIListCustomWidget(Path aNodePath, WidgetFactoryContext aContext)
public abstract void write(WidgetWriterForList aWriter, WidgetDisplayContext aContext)
public void validate(WidgetListValidationContext aValidationContext)
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.