Class UISimpleCustomWidget

java.lang.Object
com.orchestranetworks.ui.form.widget.UICustomWidget
com.orchestranetworks.ui.form.widget.UISimpleCustomWidget
All Implemented Interfaces:
UIWidget
Direct Known Subclasses:
UIWidgetFileUpload

public abstract class UISimpleCustomWidget extends UICustomWidget
Base class for custom widgets handling non-list elements.

Custom widgets handling whole list elements must extend UIListCustomWidget.

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 recommended 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 regarding the data model element. If this is not the case, an error can be added at 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

  1. When a session of EBX® generates an HTTP response including a custom widget, the specified class is instantiated by its factory.
  2. 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 Details

  • Method Details

    • write

      public abstract void write(WidgetWriter aWriter, WidgetDisplayContext aContext)
      This method defines how to display the widget.
    • validate

      public void validate(WidgetValidationContext aValidationContext)
      Offers the opportunity to perform custom validations upon user input.

      A common use case consists of retrieving the HTTP parameter values from the incoming context, checking them, then supplying the validation context with the converted values. Error messages can be supplied 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.